0.pre7.98:
[sbcl.git] / tests / filesys.pure.lisp
index 012bdbf..09e770b 100644 (file)
 (in-package "CL-USER")
 
 ;;; In sbcl-0.6.9 FOO-NAMESTRING functions  returned "" instead of NIL.
-(let ((pathname0  (make-pathname :host nil 
-                                :directory 
-                                (pathname-directory
-                                 *default-pathname-defaults*)
-                                :name "getty"))
+(let ((pathname0 (make-pathname :host nil 
+                               :directory
+                               (pathname-directory
+                                *default-pathname-defaults*)
+                               :name "getty"))
       (pathname1 (make-pathname :host nil 
                                :directory nil
                                :name nil)))
   (assert (equal (file-namestring pathname0) "getty"))
-  (assert (equal (directory-namestring pathname0) ""))
+  (assert (equal (directory-namestring pathname0)
+                (directory-namestring *default-pathname-defaults*)))
   (assert (equal (file-namestring pathname1) ""))
   (assert (equal (directory-namestring pathname1) "")))
 
                     (search "tests/filesys.pure.lisp"
                             (namestring pathname)))
                   dir)))
+
+;;; ANSI: FILE-LENGTH should signal an error of type TYPE-ERROR if
+;;; stream is not a stream associated with a file.
+;;;
+;;; (Peter Van Eynde's ansi-test suite caught this, and Eric Marsden
+;;; reported a fix for CMU CL, which was ported to sbcl-0.6.12.35.)
+(assert (typep (nth-value 1 (ignore-errors (file-length *terminal-io*)))
+              'type-error))