From e1c153e0ab116a174ea0ed88b76f222927048c5f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 16 Sep 2015 15:03:52 +0200 Subject: gexp: Add 'scheme-file'. * guix/gexp.scm (): New record type. (scheme-file, scheme-file-compiler): New procedures. * tests/gexp.scm ("scheme-file"): New test. * doc/guix.texi (G-Expressions): Document 'scheme-file'. --- tests/gexp.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/gexp.scm b/tests/gexp.scm index 77439cf6e9..4860a8e79c 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -636,6 +636,19 @@ (define shebang (return (and (zero? (close-pipe pipe)) (= n (string->number str))))))))) +(test-assertm "scheme-file" + (let* ((text (plain-file "foo" "Hello, world!")) + (scheme (scheme-file "bar" #~(list "foo" #$text)))) + (mlet* %store-monad ((drv (lower-object scheme)) + (text (lower-object text)) + (out -> (derivation->output-path drv))) + (mbegin %store-monad + (built-derivations (list drv)) + (mlet %store-monad ((refs ((store-lift references) out))) + (return (and (equal? refs (list text)) + (equal? `(list "foo" ,text) + (call-with-input-file out read))))))))) + (test-assert "text-file*" (let ((references (store-lift references))) (run-with-store %store -- cgit v1.2.3