Changeset 35368 in project


Ignore:
Timestamp:
03/31/18 20:00:24 (9 months ago)
Author:
kon
Message:

fix file-exists-in-directory? type, use test-begin

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

Legend:

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

    r35367 r35368  
    215215      (if (pathname-extension bn)
    216216        bn
    217         (make-pathname #f bn "exe") ) )
     217        (make-pathname #f bn "exe")) )
    218218    (else
    219219      bn ) ) )
     
    224224      (if (pathname-extension bn)
    225225        bn
    226         (make-pathname #f bn "bat") ) )
     226        (make-pathname #f bn "bat")) )
    227227    (else
    228228      (if (pathname-extension bn)
    229229        bn
    230         (make-pathname #f bn "sh") ) ) ) )
     230        (make-pathname #f bn "sh")) ) ) )
    231231
    232232;; Pathname if file exists in directory.
    233233
    234 (define: (file-exists-in-directory? (fil filename) . (opts (list pathname))) -> (or boolean pathname)
     234(define: (file-exists-in-directory? (fil filename) . (opts (list-of pathname))) -> (or boolean pathname)
    235235  (let* (
    236236    (dir (optional opts #f))
    237237    (path (make-pathname dir fil)) )
    238     (and (file-exists? path) path ) ) )
     238    (and (file-exists? path) path) ) )
    239239
    240240;; List of all found pathnames.
     
    253253        (append!
    254254          paths
    255           (find-file-pathnames-in-directory fil (car dirs)))) ) ) )
     255          (find-file-pathnames-in-directory fil (car dirs))))) ) )
    256256
    257257(define: (find-file-pathnames (fil filename) . (dirs (list-of pathname))) -> (or boolean (list-of pathname))
     
    270270              (or (*find-file-pathnames (make-program-filename cmd) dirs) '())
    271271              (or (*find-file-pathnames (make-shell-filename cmd) dirs) '()))) )
    272           (not-null? founds) ) ) )
     272          (not-null? founds))) )
    273273    (else
    274274      (*find-file-pathnames (make-program-filename cmd) dirs) ) ) )
  • release/4/directory-utils/trunk/tests/directory-utils-test.scm

    r35367 r35368  
    44
    55(use directory-utils)
     6
     7(test-begin "directory-utils")
    68
    79(test-assert (pathname? "abc/cbs.foo"))
     
    4547(test-assert (pop-toplevel-directory)) ;(pop-directory)
    4648
     49(test-end "directory-utils")
     50
    4751(test-exit)
Note: See TracChangeset for help on using the changeset viewer.