ftw: Add `scandir'.

Suggested by Nala Ginrut <nalaginrut@gmail.com>.

* module/ice-9/ftw.scm (scandir): New procedure.
* test-suite/tests/ftw.test ("scandir"): New test prefix.
* doc/ref/misc-modules.texi (File Tree Walk): Document `scandir'.
This commit is contained in:
Ludovic Courtès 2011-12-18 21:14:33 +01:00
commit 1629429d63
3 changed files with 51 additions and 1 deletions

View file

@ -166,3 +166,11 @@
expected)))
(_ #f))
children)))))
(with-test-prefix "scandir"
(pass-if "test-suite"
(let ((select? (cut string-suffix? ".test" <>)))
(match (scandir (string-append %test-dir "/tests") select?)
(("." ".." "00-initial-env.test" (? select?) ...)
#t)))))