mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
inferior: Add 'inferior-eval-with-store' tests.
* tests/inferior.scm ("inferior-eval-with-store, exception") ("inferior-eval-with-store, not a procedure"): New tests.
This commit is contained in:
parent
3d43b7aef3
commit
074a201c33
1 changed files with 21 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
|
@ -213,6 +213,26 @@ (define result
|
|||
"uh uh")))
|
||||
#f)))
|
||||
|
||||
(test-equal "inferior-eval-with-store, exception"
|
||||
'(the-answer = 42)
|
||||
(let ((inferior (open-inferior %top-builddir
|
||||
#:command "scripts/guix")))
|
||||
(guard (c ((inferior-exception? c)
|
||||
(close-inferior inferior)
|
||||
(inferior-exception-arguments c)))
|
||||
(inferior-eval-with-store inferior %store
|
||||
'(lambda (store)
|
||||
(throw 'the-answer '= 42))))))
|
||||
|
||||
(test-equal "inferior-eval-with-store, not a procedure"
|
||||
'wrong-type-arg
|
||||
(let ((inferior (open-inferior %top-builddir
|
||||
#:command "scripts/guix")))
|
||||
(guard (c ((inferior-exception? c)
|
||||
(close-inferior inferior)
|
||||
(car (inferior-exception-arguments c))))
|
||||
(inferior-eval-with-store inferior %store '(+ 1 2)))))
|
||||
|
||||
(test-equal "inferior-package-derivation"
|
||||
(map derivation-file-name
|
||||
(list (package-derivation %store %bootstrap-guile "x86_64-linux")
|
||||
|
|
Loading…
Reference in a new issue