source: project/release/4/directory-utils/trunk/tests/directory-utils-test.scm @ 35366

Last change on this file since 35366 was 35366, checked in by Kon Lovett, 2 years ago

-test.scm exists, own kwd arg processing

File size: 1.3 KB
Line 
1;;;; directory-utils-test.scm
2
3(use test)
4
5(use directory-utils)
6
7(test-assert (pathname? "abc/cbs.foo"))
8(test-assert (pathname? "abc/cbs"))
9(test-assert (pathname? ".abc"))
10(test-assert (not (pathname? "")))
11
12(test-assert (not (filename? "abc/cbs.foo")))
13(test-assert (filename? "cbs.foo"))
14
15(test-assert (not (dot-pathname? "abc/cbs.foo")))
16(test-assert (dot-pathname? "/abc/.hide/hidden"))
17(test-assert (not (dot-pathname? "/abc/cbs/./foo")))
18(test-assert (not (dot-pathname? "/abc/cbs/../foo")))
19(test-assert (dot-pathname? "/abc/cbs/../.foo"))
20(test-assert (dot-pathname? "/abc/cbs/../.foo/bar"))
21
22(test-assert (dot-filename? ".hide"))
23(test-assert (not (dot-filename? "/abc/.hide/hidden")))
24(test-assert (not (dot-filename? ".")))
25(test-assert (not (dot-filename? "..")))
26
27(test '("abc/cbs.foo") (remove-dotfiles '(".hide" "abc/cbs.foo")))
28
29(test-assert (which-command-pathnames "mkdir"))
30(test-assert (not (which-command-pathnames "93274030#$%)#)$()")))
31
32(test "directory-fold" 2 (directory-fold (lambda (fn ct) (fx+ ct 1) ) 0 "." #:dotfiles? #f))
33
34(test-assert (push-directory ".."))
35
36(let ((dotno (directory-fold (lambda (fn ct) (fx+ ct 1)) 0 "." #:dotfiles? #f)))
37  (test-assert "directory-fold" (< 1 dotno)) )
38
39(test-assert (pop-toplevel-directory)) ;(pop-directory)
40
41(test-exit)
Note: See TracBrowser for help on using the repository browser.