diff --git a/tests/gexp.scm b/tests/gexp.scm index 83fe81154..31c7ce22f 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -948,7 +948,7 @@ (return (and (zero? (close-pipe pipe)) (= (expt n 2) (string->number str))))))) -(test-assertm "gexp->script #:module-path" +(test-assert "gexp->script #:module-path" (call-with-temporary-directory (lambda (directory) (define str @@ -961,23 +961,24 @@ (define-public %fake! ,str)) port))) - (mlet* %store-monad ((exp -> (with-imported-modules '((guix base32)) - (gexp (begin - (use-modules (guix base32)) - (write (list %load-path - %fake!)))))) - (drv (gexp->script "guile-thing" exp - #:guile %bootstrap-guile - #:module-path (list directory))) - (out -> (derivation->output-path drv)) - (done (built-derivations (list drv)))) - (let* ((pipe (open-input-pipe out)) - (data (read pipe))) - (return (and (zero? (close-pipe pipe)) - (match data - ((load-path str*) - (and (string=? str* str) - (not (member directory load-path)))))))))))) + (run-with-store %store + (mlet* %store-monad ((exp -> (with-imported-modules '((guix base32)) + (gexp (begin + (use-modules (guix base32)) + (write (list %load-path + %fake!)))))) + (drv (gexp->script "guile-thing" exp + #:guile %bootstrap-guile + #:module-path (list directory))) + (out -> (derivation->output-path drv)) + (done (built-derivations (list drv)))) + (let* ((pipe (open-input-pipe out)) + (data (read pipe))) + (return (and (zero? (close-pipe pipe)) + (match data + ((load-path str*) + (and (string=? str* str) + (not (member directory load-path))))))))))))) (test-assertm "program-file" (let* ((n (random (expt 2 50)))