Changeset 10084


Ignore:
Timestamp:
10/06/05 12:29:52 (16 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/tests/file-system-tests.lisp

    r10078 r10084  
    6666
    6767(defun pathnames-equal-p (pathname1 pathname2)
    68   #-(or allegro cmu lispworks)
     68  #-(or allegro clisp cmu lispworks)
    6969  (equal pathname1 pathname2)
    70   #+(or allegro cmu)
     70  #+(or allegro clisp cmu)
    7171  (and (pathnamep pathname1)
    7272       (pathnamep pathname2)
     
    208208  )
    209209
    210 (defun delete-directory-and-files (pathspec &key (quiet t))
    211   #+(or clisp lispworks)
    212   (error "DELETE-DIRECTORY-AND-FILES doesn't work on CLISP or LispWorks yet!")
     210(defun delete-directory-and-files (pathspec &key (quiet t) (dry-run nil))
     211  #+(or lispworks)
     212  (error "DELETE-DIRECTORY-AND-FILES not implemented")
    213213  (let* ((namestring (namestring pathspec))
    214214         (len (length namestring))
     
    220220        (error "Directory does not exist: ~S" pathname))
    221221      (unless quiet
    222         (format t "processing directory ~S~%" pathname))
     222        (format t "~&processing directory ~S~%" pathname))
    223223      (let ((list (directory (make-pathname :name :wild
    224                                             :type :wild
     224                                            :type #-clisp :wild #+clisp nil
    225225                                            :defaults pathname))))
    226226        (dolist (x list)
     
    228228                 (delete-directory-and-files x :quiet quiet))
    229229                (t
    230                  (delete-file x)
    231230                 (unless quiet
    232                    (format t "deleting file ~S~%" x))
    233                  )))
     231                   (format t "~&deleting file ~S~%" x))
     232                 (unless dry-run
     233                   (delete-file x)))))
    234234        (unless quiet
    235           (format t "deleting directory ~S~%" pathname))
    236         (delete-directory pathname)
    237         ))))
     235          (format t "~&deleting directory ~S~%" pathname))
     236        (unless dry-run
     237          (delete-directory pathname))))))
    238238
    239239#-(or allegro clisp lispworks windows)
     
    283283
    284284(deftest probe-file.3
     285  (let ((pathname #p"./"))
     286    #-clisp
     287    (pathnames-equal-p (probe-file pathname) *this-directory*)
     288    #+clisp
     289    ;; "no file name given"
     290    (signals-error (probe-file pathname) 'file-error))
     291  t)
     292
     293(deftest probe-file.4
    285294  (let ((pathname #p".."))
    286295    #-clisp
     
    295304  t)
    296305
     306(deftest truename.2
     307  (pathnames-equal-p (truename #p"./") *this-directory*)
     308  t)
     309
    297310(deftest directory.1
    298311  (let ((list (directory *this-file*)))
     
    302315  t)
    303316
     317;; Verify that DIRECTORY returns nil if the directory is empty.
    304318(deftest directory.2
     319  (let* ((tmp (make-temporary-filename *this-directory*))
     320         (directory-namestring (concatenate 'string (namestring tmp) "/"))
     321         (directory-pathname (pathname directory-namestring)))
     322    (unwind-protect
     323        (progn
     324          (make-directory directory-pathname)
     325          (directory (make-pathname :name :wild :defaults directory-pathname)))
     326      (delete-directory-and-files directory-pathname)))
     327  nil)
     328
     329(deftest directory.3
    305330  (let* ((tmp (make-temporary-filename *this-directory*))
    306331         (directory-namestring (concatenate 'string (namestring tmp) "/"))
Note: See TracChangeset for help on using the changeset viewer.