aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/gexp.scm18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm
index db0ffd2fdd..f504b92d84 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -33,7 +33,8 @@
#:use-module (rnrs io ports)
#:use-module (ice-9 match)
#:use-module (ice-9 regex)
- #:use-module (ice-9 popen))
+ #:use-module (ice-9 popen)
+ #:use-module (ice-9 ftw))
;; Test the (guix gexp) module.
@@ -132,6 +133,21 @@
(lambda ()
(false-if-exception (delete-file link))))))
+(test-assertm "local-file, #:select?"
+ (mlet* %store-monad ((select? -> (lambda (file stat)
+ (member (basename file)
+ '("guix.scm" "tests"
+ "gexp.scm"))))
+ (file -> (local-file ".." "directory"
+ #:recursive? #t
+ #:select? select?))
+ (dir (lower-object file)))
+ (return (and (store-path? dir)
+ (equal? (scandir dir)
+ '("." ".." "guix.scm" "tests"))
+ (equal? (scandir (string-append dir "/tests"))
+ '("." ".." "gexp.scm"))))))
+
(test-assert "one plain file"
(let* ((file (plain-file "hi" "Hello, world!"))
(exp (gexp (display (ungexp file))))