diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-09-09 09:44:43 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-10-10 22:46:14 +0200 |
commit | b751cde36b508690d5f893360f964d3098549131 (patch) | |
tree | 2a0d68122bb43b245706388fb2e5e8f00063e7da /tests/gexp.scm | |
parent | 15a01c72209b2d43239fe7516a22e531b7fcb85f (diff) | |
download | guix-b751cde36b508690d5f893360f964d3098549131.tar.gz |
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.
Diffstat (limited to 'tests/gexp.scm')
-rw-r--r-- | tests/gexp.scm | 15 |
1 files changed, 15 insertions, 0 deletions
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 |