diff options
author | Mark H Weaver <mhw@netris.org> | 2018-04-11 17:19:06 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2018-04-11 17:19:06 -0400 |
commit | 3c0316169b47a1c035390aae8a211dcbedc8f5f3 (patch) | |
tree | 3c89536e1ef0c1db4339175bce7ff64d2e42f591 /tests | |
parent | ecfe88b76496c62fad4f6b6c593318378cebba22 (diff) | |
parent | 87a841b2d4b7f8bfd661ba2d2cd2bbce7f490fbd (diff) |
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 2f8940e2c6..3c8b4624da 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -419,6 +419,24 @@ (call-with-input-file out read)) (equal? (list guile) refs))))) +(test-assertm "gexp->file + #:splice?" + (mlet* %store-monad ((exp -> (list + #~(define foo 'bar) + #~(define guile #$%bootstrap-guile))) + (guile (package-file %bootstrap-guile)) + (drv (gexp->file "splice" exp #:splice? #t)) + (out -> (derivation->output-path drv)) + (done (built-derivations (list drv))) + (refs (references* out))) + (pk 'splice out) + (return (and (equal? `((define foo 'bar) + (define guile ,guile) + ,(call-with-input-string "" read)) + (call-with-input-file out + (lambda (port) + (list (read port) (read port) (read port))))) + (equal? (list guile) refs))))) + (test-assertm "gexp->derivation" (mlet* %store-monad ((file (text-file "foo" "Hello, world!")) (exp -> (gexp @@ -700,11 +718,12 @@ (test-assertm "gexp->derivation & with-imported-module & computed module" (mlet* %store-monad - ((module -> (scheme-file "x" #~(begin + ((module -> (scheme-file "x" #~(;; splice! (define-module (foo bar) #:export (the-answer)) - (define the-answer 42)))) + (define the-answer 42)) + #:splice? #t)) (build -> (with-imported-modules `(((foo bar) => ,module) (guix build utils)) #~(begin |