diff options
author | Ludovic Courtès <ludo@gnu.org> | 2014-07-24 22:27:35 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-07-24 23:02:26 +0200 |
commit | 0a90af153199b03deced53da7ef7f50f0e561f80 (patch) | |
tree | 38c39490e95c2f2efc61ef9ab74de1bffd35e851 /tests | |
parent | 7ab44369b34a23e5d22ac51b7fbfe31c0de9fbfd (diff) |
monads: Add 'interned-file'.
* guix/monads.scm (interned-file): New procedure.
* tests/monads.scm ("interned-file"): New test.
* doc/guix.texi (The Store Monad): Document it.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/monads.scm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/monads.scm b/tests/monads.scm index ac19d33f93..ea3e4006ab 100644 --- a/tests/monads.scm +++ b/tests/monads.scm @@ -108,6 +108,16 @@ guile))) #:guile-for-build (package-derivation %store %bootstrap-guile))) +(test-assert "interned-file" + (run-with-store %store + (mlet* %store-monad ((file -> (search-path %load-path "guix.scm")) + (a (interned-file file)) + (b (interned-file file "b"))) + (return (equal? (call-with-input-file file get-string-all) + (call-with-input-file a get-string-all) + (call-with-input-file b get-string-all)))) + #:guile-for-build (package-derivation %store %bootstrap-guile))) + (define derivation-expression (@@ (guix monads) derivation-expression)) |