diff options
author | Mark H Weaver <mhw@netris.org> | 2015-06-21 14:30:22 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2015-06-21 14:30:22 -0400 |
commit | bf76d98789a0fc6303c303beddbc1ed609f2a6ea (patch) | |
tree | 1df8db2fa06f6826a1c7a1cb1faa253df704834e /tests | |
parent | fc9ff915b3cfcb494dbb5c8ab767972352fa31da (diff) | |
parent | 12b04cbee6b9c725db8a5c898b597de8e667bef0 (diff) | |
download | guix-bf76d98789a0fc6303c303beddbc1ed609f2a6ea.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gexp.scm | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm index 7e14073fd4..32031663f5 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -101,7 +101,7 @@ (let* ((file (search-path %load-path "guix.scm")) (local (local-file file)) (exp (gexp (display (ungexp local)))) - (intd (add-to-store %store (basename file) #t + (intd (add-to-store %store (basename file) #f "sha256" file))) (and (gexp? exp) (match (gexp-inputs exp) @@ -109,6 +109,25 @@ (eq? x local))) (equal? `(display ,intd) (gexp->sexp* exp))))) +(test-assert "one local file, symlink" + (let ((file (search-path %load-path "guix.scm")) + (link (tmpnam))) + (dynamic-wind + (const #t) + (lambda () + (symlink (canonicalize-path file) link) + (let* ((local (local-file link "my-file" #:recursive? #f)) + (exp (gexp (display (ungexp local)))) + (intd (add-to-store %store "my-file" #f + "sha256" file))) + (and (gexp? exp) + (match (gexp-inputs exp) + (((x "out")) + (eq? x local))) + (equal? `(display ,intd) (gexp->sexp* exp))))) + (lambda () + (false-if-exception (delete-file link)))))) + (test-assert "one plain file" (let* ((file (plain-file "hi" "Hello, world!")) (exp (gexp (display (ungexp file)))) @@ -360,7 +379,7 @@ (test-assertm "gexp->derivation, local-file" (mlet* %store-monad ((file -> (search-path %load-path "guix.scm")) - (intd (interned-file file)) + (intd (interned-file file #:recursive? #f)) (local -> (local-file file)) (exp -> (gexp (begin (stat (ungexp local)) |