diff --git a/module/ice-9/ftw.scm b/module/ice-9/ftw.scm index eed3eeb19..5f6115427 100644 --- a/module/ice-9/ftw.scm +++ b/module/ice-9/ftw.scm @@ -530,7 +530,7 @@ of file names is sorted according to ENTRY (file-system-fold enter? leaf down up skip #f name stat) (lambda (files) diff --git a/test-suite/tests/ftw.test b/test-suite/tests/ftw.test index 41c731a7a..fa179d400 100644 --- a/test-suite/tests/ftw.test +++ b/test-suite/tests/ftw.test @@ -169,6 +169,18 @@ (with-test-prefix "scandir" + (pass-if "top-srcdir" + (let ((valid? (negate (cut string-any #\/ <>)))) + (match (scandir %top-srcdir) + (((? valid? files) ...) + ;; Both subdirs and files must be included. + (let ((expected '("libguile" "README" "COPYING" + "test-suite" "Makefile.am" + "." ".."))) + (lset= string=? + (lset-intersection string=? files expected) + expected)))))) + (pass-if "test-suite" (let ((select? (cut string-suffix? ".test" <>))) (match (scandir (string-append %test-dir "/tests") select?)