Update of /cvsroot/sbcl/sbcl/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19838/tests
Modified Files:
pathnames.impure.lisp
Log Message:
0.8.7.24:
More pathname fun, *sigh*
... make logical pathnames respect print/read consistency (version
*is* significant for them)
... adjust the pathname tests so that they test equality rather
than namestring equality, but minus version testing
because that's too complicated right now.
Index: pathnames.impure.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/tests/pathnames.impure.lisp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- pathnames.impure.lisp 27 Jan 2004 10:34:59 -0000 1.19
+++ pathnames.impure.lisp 27 Jan 2004 14:24:06 -0000 1.20
@@ -264,8 +264,13 @@
;; FIXME: test version handling in LPNs
)
- do (assert (string= (namestring (apply #'merge-pathnames params))
- (namestring expected-result))))
+ do (let ((result (apply #'merge-pathnames params)))
+ (macrolet ((frob (op)
+ `(assert (equal (,op result) (,op expected-result)))))
+ (frob pathname-host)
+ (frob pathname-directory)
+ (frob pathname-name)
+ (frob pathname-type))))
;;; host-namestring testing
(assert (string=
@@ -293,5 +298,21 @@
(assert (raises-error? (merge-pathnames (make-string-output-stream))
type-error))
+;;; ensure read/print consistency (or print-not-readable-error) on
+;;; pathnames:
+(let ((pathnames (list
+ (make-pathname :name "foo" :type "txt" :version :newest)
+ (make-pathname :name "foo" :type "txt" :version 1)
+ (make-pathname :name "foo" :type ".txt")
+ (make-pathname :name "foo." :type "txt")
+ (parse-namestring "SCRATCH:FOO.TXT.1")
+ (parse-namestring "SCRATCH:FOO.TXT.NEWEST")
+ (parse-namestring "SCRATCH:FOO.TXT"))))
+ (dolist (p pathnames)
+ (handler-case
+ (let ((*print-readably* t))
+ (assert (equal (read-from-string (format nil "~S" p)) p)))
+ (print-not-readable () nil))))
+
;;;; success
(quit :unix-status 104)
|