aboutsummaryrefslogtreecommitdiff
path: root/tests/gexp.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-04-03 23:52:19 +0200
committerLudovic Courtès <ludo@gnu.org>2017-04-04 00:10:00 +0200
commit3e43166ffc11fb117c55da594e57866a75625900 (patch)
tree9f77a65750631ca2b6e5c5a0b7b55daa71f23b73 /tests/gexp.scm
parentb98d4ec0aaab744ad3452cc57f9598db58a0e352 (diff)
downloadguix-3e43166ffc11fb117c55da594e57866a75625900.tar
guix-3e43166ffc11fb117c55da594e57866a75625900.tar.gz
gexp: 'lower-object' raises an exception when passed an invalid object.
* guix/gexp.scm (&gexp-error, &gexp-input-error): New error conditions. (lower-object): Raise &gexp-input-error when 'lookup-compiler' returns #f. * tests/gexp.scm ("lower-object & gexp-input-error?"): New test. * guix/ui.scm (call-with-error-handling): Add case for 'gexp-input-error?'.
Diffstat (limited to 'tests/gexp.scm')
-rw-r--r--tests/gexp.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm
index b3f7323984..41a53ae5a4 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -946,6 +946,13 @@
(string=? (readlink (string-append comp "/text"))
text)))))))
+(test-assert "lower-object & gexp-input-error?"
+ (guard (c ((gexp-input-error? c)
+ (gexp-error-invalid-input c)))
+ (run-with-store %store
+ (lower-object (current-module))
+ #:guile-for-build (%guile-for-build))))
+
(test-assert "printer"
(string-match "^#<gexp \\(string-append .*#<package coreutils.*\
\"/bin/uname\"\\) [[:xdigit:]]+>$"