summaryrefslogtreecommitdiff
path: root/tests/gexp.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-06-03 11:45:27 +0200
committerLudovic Courtès <ludo@gnu.org>2015-06-03 11:47:36 +0200
commit558e8b11d77ed79c1ae0baf5fda66cfc083bab4b (patch)
tree0ce333a9bea9554192c9c26b8ec0b6cb114383ab /tests/gexp.scm
parent74d441abeee257f5d7ec5bb5fa0db70bd26802b7 (diff)
gexp: Add 'plain-file'.
* guix/gexp.scm (<plain-file>): New type. (plain-file, plain-file-compiler): New procedures. * tests/gexp.scm ("one plain file"): New test. * doc/guix.texi (G-Expressions): Document 'plain-file'.
Diffstat (limited to 'tests/gexp.scm')
-rw-r--r--tests/gexp.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm
index f81ef39860..7e14073fd4 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -109,6 +109,16 @@
(eq? x local)))
(equal? `(display ,intd) (gexp->sexp* exp)))))
+(test-assert "one plain file"
+ (let* ((file (plain-file "hi" "Hello, world!"))
+ (exp (gexp (display (ungexp file))))
+ (expected (add-text-to-store %store "hi" "Hello, world!")))
+ (and (gexp? exp)
+ (match (gexp-inputs exp)
+ (((x "out"))
+ (eq? x file)))
+ (equal? `(display ,expected) (gexp->sexp* exp)))))
+
(test-assert "same input twice"
(let ((exp (gexp (begin
(display (ungexp coreutils))