Changeset 35366 in project


Ignore:
Timestamp:
03/31/18 07:43:43 (4 months ago)
Author:
kon
Message:

-test.scm exists, own kwd arg processing

Location:
release/4/directory-utils/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/directory-utils/trunk/directory-utils.scm

    r35365 r35366  
    165165;attribute, the MacOS X birthtime, etc.
    166166
    167 ;(: directory-fold (procedure * pathname #!rest -> *))
    168 ;
    169167(define: (directory-fold (func procedure) (ident *) (dir pathname) . (opts (list pathname))) -> *
    170   (let (
    171     (dotfiles? (get-keyword #:dotfiles? opts (lambda () #f))) )
    172     (fold
    173       (check-procedure 'directory-fold func)
    174       ident
    175       (directory (check-directory 'directory-fold dir) dotfiles?)) ) )
     168  (check-procedure 'directory-fold func)
     169  (let* (
     170    (dotfiles? (get-keyword #:dotfiles? opts (lambda () #f)))
     171    (dir (directory (check-directory 'directory-fold dir) dotfiles?)) )
     172    (fold func ident dir) ) )
    176173
    177174;; Directory Stack
  • release/4/directory-utils/trunk/tests/directory-utils-test.scm

    r35364 r35366  
     1;;;; directory-utils-test.scm
     2
    13(use test)
    24
     
    2830(test-assert (not (which-command-pathnames "93274030#$%)#)$()")))
    2931
    30 (test "directory-fold" 1 (directory-fold (lambda (fn ct) (fx+ ct 1) ) 0 "." #:dotfiles? #f))
     32(test "directory-fold" 2 (directory-fold (lambda (fn ct) (fx+ ct 1) ) 0 "." #:dotfiles? #f))
    3133
    3234(test-assert (push-directory ".."))
    3335
    34 (test-assert "directory-fold"
    35   (< 1 (directory-fold (lambda (fn ct) (fx+ ct 1) ) 0 "." #:dotfiles? #f)))
     36(let ((dotno (directory-fold (lambda (fn ct) (fx+ ct 1)) 0 "." #:dotfiles? #f)))
     37  (test-assert "directory-fold" (< 1 dotno)) )
    3638
    3739(test-assert (pop-toplevel-directory)) ;(pop-directory)
Note: See TracChangeset for help on using the changeset viewer.