From 3e43166ffc11fb117c55da594e57866a75625900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 3 Apr 2017 23:52:19 +0200 Subject: 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?'. --- tests/gexp.scm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/gexp.scm') 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 "^#$" -- cgit v1.2.3