From b751cde36b508690d5f893360f964d3098549131 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 9 Sep 2015 09:44:43 +0200 Subject: gexp: Add 'mixed-text-file'. * guix/gexp.scm (mixed-text-file): New procedure. * tests/gexp.scm ("mixed-text-file"): New test. * doc/guix.texi (G-Expressions): Document it. --- tests/gexp.scm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/gexp.scm') diff --git a/tests/gexp.scm b/tests/gexp.scm index 0a8ce6544f..77439cf6e9 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -660,6 +660,21 @@ file))))) #:guile-for-build (package-derivation %store %bootstrap-guile)))) +(test-assertm "mixed-text-file" + (mlet* %store-monad ((file -> (mixed-text-file "mixed" + "export PATH=" + %bootstrap-guile "/bin")) + (drv (lower-object file)) + (out -> (derivation->output-path drv)) + (guile-drv (package->derivation %bootstrap-guile)) + (guile -> (derivation->output-path guile-drv))) + (mbegin %store-monad + (built-derivations (list drv)) + (mlet %store-monad ((refs ((store-lift references) out))) + (return (and (string=? (string-append "export PATH=" guile "/bin") + (call-with-input-file out get-string-all)) + (equal? refs (list guile)))))))) + (test-assert "gexp->derivation vs. %current-target-system" (let ((mval (gexp->derivation "foo" #~(begin -- cgit v1.2.3