From 919370291f4f9cc93878eea7db11013949ee8473 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 7 Sep 2015 22:37:14 +0200 Subject: gexp: Add 'computed-file'. * guix/gexp.scm (): New record type. (computed-file, computed-file-compiler): New procedures. * tests/gexp.scm ("lower-object, computed-file"): New test. * doc/guix.texi (G-Expressions): Document 'computed-file'. --- tests/gexp.scm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests') diff --git a/tests/gexp.scm b/tests/gexp.scm index 492f3d6d89..ccbbbae7da 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -661,6 +661,25 @@ (return (and (derivation? drv1) (derivation? drv2) (store-path? item))))) +(test-assertm "lower-object, computed-file" + (let* ((text (plain-file "foo" "Hello!")) + (exp #~(begin + (mkdir #$output) + (symlink #$%bootstrap-guile + (string-append #$output "/guile")) + (symlink #$text (string-append #$output "/text")))) + (computed (computed-file "computed" exp))) + (mlet* %store-monad ((text (lower-object text)) + (guile-drv (lower-object %bootstrap-guile)) + (comp-drv (lower-object computed)) + (comp -> (derivation->output-path comp-drv))) + (mbegin %store-monad + (built-derivations (list comp-drv)) + (return (and (string=? (readlink (string-append comp "/guile")) + (derivation->output-path guile-drv)) + (string=? (readlink (string-append comp "/text")) + text))))))) + (test-assert "printer" (string-match "^#$" -- cgit v1.2.3