Changeset 10085


Ignore:
Timestamp:
10/06/05 19:40:34 (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

    r10084 r10085  
    3737(regression-test:rem-all-tests)
    3838
    39 (let ((*package* (find-package '#:rt)))
     39(let ((*package* (find-package '#:regression-test)))
    4040  (export (find-symbol (string '#:*expected-failures*))))
    4141
     
    180180  #+abcl (ext:probe-directory pathname)
    181181  #+allegro (excl:probe-directory pathname)
    182   #+clisp (ext:probe-directory pathname)
     182  #+clisp (ignore-errors (ext:probe-directory pathname))
    183183  #+cmu (probe-file pathname) ; FIXME
    184184  #+sbcl (probe-file pathname) ; FIXME
     185  #+lispworks (probe-file pathname)
    185186  )
    186187
     
    206207  #+cmu (unix:unix-rmdir (namestring pathname))
    207208  #+sbcl (zerop (sb-posix:rmdir (namestring pathname)))
     209  #+lispworks (lw:delete-directory pathname)
    208210  )
    209211
    210212(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))
     
    300300  t)
    301301
     302(deftest probe-file.5
     303  (or
     304   ;; It might not exist. That's OK.
     305   (null (probe-directory #p"/home/"))
     306   (pathnames-equal-p (probe-file #p"/home") (probe-file #p"/home/")))
     307  t)
     308#+(or allegro clisp)
     309(pushnew 'probe-file.5 *expected-failures*)
     310
    302311(deftest truename.1
    303312  (pathnames-equal-p (truename *this-file*) *this-file*)
     
    327336  nil)
    328337
     338;; A directory with a one file named "foo".
    329339(deftest directory.3
    330340  (let* ((tmp (make-temporary-filename *this-directory*))
     
    336346          (let ((file-pathname (make-pathname :name "foo" :defaults directory-pathname)))
    337347            (touch file-pathname)
    338             (equal
    339              (directory (make-pathname :name :wild :defaults directory-pathname))
    340              (list file-pathname))))
     348            (let ((directory (directory (make-pathname :name :wild
     349                                                       :defaults directory-pathname))))
     350              (and (listp directory)
     351                   (= (length directory) 1)
     352                   (pathnames-equal-p (car directory) file-pathname)))))
    341353      (delete-directory-and-files directory-pathname)))
    342354  t)
     355
     356;; Same as DIRECTORY.3, but use :type :wild for the wildcard.
     357(deftest directory.4
     358  (let* ((tmp (make-temporary-filename *this-directory*))
     359         (directory-namestring (concatenate 'string (namestring tmp) "/"))
     360         (directory-pathname (pathname directory-namestring)))
     361    (unwind-protect
     362        (progn
     363          (make-directory directory-pathname)
     364          (let ((file-pathname (make-pathname :name "foo" :defaults directory-pathname)))
     365            (touch file-pathname)
     366            (let ((directory (directory (make-pathname :name :wild
     367                                                       :type :wild
     368                                                       :defaults directory-pathname))))
     369              (and (listp directory)
     370                   (= (length directory) 1)
     371                   (pathnames-equal-p (car directory) file-pathname)))))
     372      (delete-directory-and-files directory-pathname)))
     373  t)
     374#+clisp
     375;; A pathname with type nil does not match a wildcard with type :WILD.
     376(pushnew 'directory.4 *expected-failures*)
    343377
    344378#-windows
Note: See TracChangeset for help on using the changeset viewer.