From 0a90af153199b03deced53da7ef7f50f0e561f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 24 Jul 2014 22:27:35 +0200 Subject: 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. --- tests/monads.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/monads.scm') 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)) -- cgit v1.2.3