Commit fac03ad2 authored by Daniel Kochmański's avatar Daniel Kochmański

restruct: adjust pathname (still wip)

Signed-off-by: 's avatarDaniel Kochmański <daniel@turtleware.eu>
parent 9858efa4
*.out
*.dat
*.fas
ansi-aux-macros.fas
ansi-aux.fas
......
......@@ -6,23 +6,23 @@
(deftest directory.1
(directory "nonexistent")
(directory "sample-files/nonexistent")
nil)
(deftest directory.2
(directory #p"nonexistent")
(directory #p"sample-files/nonexistent")
nil)
(deftest directory.3
(directory "nonexistent" :allow-other-keys nil)
(directory "sample-files/nonexistent" :allow-other-keys nil)
nil)
(deftest directory.4
(directory "nonexistent" :allow-other-keys t :foo 'bar)
(directory "sample-files/nonexistent" :allow-other-keys t :foo 'bar)
nil)
(deftest directory.5
(directory "nonexistent" :foo 0 :allow-other-keys t)
(directory "sample-files/nonexistent" :foo 0 :allow-other-keys t)
nil)
(deftest directory.6
......@@ -60,7 +60,7 @@
(deftest directory.9
(do-special-strings
(s "nonexistent" nil)
(s "sample-files/nonexistent" nil)
(assert (null (directory s))))
nil)
......
......@@ -3,10 +3,8 @@
;;;; Created: Mon Jan 5 20:53:03 2004
;;;; Contains: Tests of ENSURE-DIRECTORIES-EXIST
(deftest ensure-directories-exist.1
(let* ((pn (make-pathname :name "ensure-directories-exist.lsp"
(let* ((pn (make-pathname :name "sample-files/ensure-directories-exist.txt"
:defaults *default-pathname-defaults*))
(results nil)
(verbosity
......@@ -22,7 +20,7 @@
(deftest ensure-directories-exist.2
(with-open-file
(s "ensure-directories-exist.lsp" :direction :input)
(s "sample-files/ensure-directories-exist.txt" :direction :input)
(let* ((results (multiple-value-list (ensure-directories-exist s))))
(values
(length results)
......@@ -31,7 +29,7 @@
2 t nil)
(deftest ensure-directories-exist.3
(let ((s (open "ensure-directories-exist.lsp" :direction :input)))
(let ((s (open "sample-files/ensure-directories-exist.txt" :direction :input)))
(close s)
(let* ((results (multiple-value-list (ensure-directories-exist s))))
(values
......@@ -41,7 +39,7 @@
2 t nil)
(deftest ensure-directories-exist.4
(let* ((pn (make-pathname :name "ensure-directories-exist.lsp"
(let* ((pn (make-pathname :name "sample-files/ensure-directories-exist.txt"
:defaults *default-pathname-defaults*))
(results nil)
(verbosity
......@@ -57,7 +55,7 @@
2 t nil "")
(deftest ensure-directories-exist.5
(let* ((pn (make-pathname :name "ensure-directories-exist.lsp"
(let* ((pn (make-pathname :name "sample-files/ensure-directories-exist.txt"
:defaults *default-pathname-defaults*))
(results nil)
(verbosity
......@@ -73,7 +71,7 @@
2 t nil "")
(deftest ensure-directories-exist.6
(let* ((pn (make-pathname :name "ensure-directories-exist.lsp"
(let* ((pn (make-pathname :name "sample-files/ensure-directories-exist.txt"
:defaults *default-pathname-defaults*))
(results nil)
(verbosity
......@@ -90,7 +88,7 @@
2 t nil "")
(deftest ensure-directories-exist.7
(let* ((pn (make-pathname :name "ensure-directories-exist.lsp"
(let* ((pn (make-pathname :name "sample-files/ensure-directories-exist.txt"
:defaults *default-pathname-defaults*))
(results nil)
(verbosity
......@@ -142,7 +140,7 @@
(deftest ensure-directories-exist.9
(do-special-strings
(str "ensure-directories-exist.lsp" nil)
(str "sample-files/ensure-directories-exist.txt" nil)
(let* ((results (multiple-value-list (ensure-directories-exist str))))
(assert (eql (length results) 2))
(assert (equalt (truename (first results)) (truename str)))
......
......@@ -15,28 +15,28 @@
nil)
(deftest file-author.2
(let ((author (file-author "file-author.lsp")))
(let ((author (file-author "sample-files/file-author.txt")))
(if (or (null author) (stringp author))
nil
author))
nil)
(deftest file-author.3
(let ((author (file-author #p"file-author.lsp")))
(let ((author (file-author #p"sample-files/file-author.txt")))
(if (or (null author) (stringp author))
nil
author))
nil)
(deftest file-author.4
(let ((author (file-author (truename "file-author.lsp"))))
(let ((author (file-author (truename "sample-files/file-author.txt"))))
(if (or (null author) (stringp author))
nil
author))
nil)
(deftest file-author.5
(let ((author (with-open-file (s "file-author.lsp" :direction :input)
(let ((author (with-open-file (s "sample-files/file-author.txt" :direction :input)
(file-author s))))
(if (or (null author) (stringp author))
nil
......@@ -44,7 +44,7 @@
nil)
(deftest file-author.6
(let ((author (let ((s (open "file-author.lsp" :direction :input)))
(let ((author (let ((s (open "sample-files/file-author.txt" :direction :input)))
(close s)
(file-author s))))
(if (or (null author) (stringp author))
......@@ -56,8 +56,8 @@
(deftest file-author.7
(do-special-strings
(s "file-author.lsp" nil)
(assert (equal (file-author s) (file-author "file-author.lsp"))))
(s "sample-files/file-author.txt" nil)
(assert (equal (file-author s) (file-author "sample-files/file-author.txt"))))
nil)
;;; FIXME
......@@ -70,7 +70,7 @@
t)
(deftest file-author.error.2
(signals-error (file-author "file-author.lsp" nil) program-error)
(signals-error (file-author "sample-files/file-author.txt" nil) program-error)
t)
(deftest file-author.error.3
......@@ -82,7 +82,7 @@
(deftest file-author.error.4
(signals-error-always
(file-author (make-pathname :name "file-author" :type :wild
(file-author (make-pathname :name "sample-files/file-author" :type :wild
:defaults *default-pathname-defaults*))
file-error)
t t)
......@@ -21,41 +21,42 @@
t t)
(deftest file-error-pathname.1
(let ((c (make-condition 'file-error :pathname "foo.txt")))
(let ((c (make-condition 'file-error :pathname "scratch/foo.txt")))
(values
(notnot (typep c 'file-error))
(eqlt (class-of c) (find-class 'file-error))
(file-error-pathname c)))
t t "foo.txt")
t t "scratch/foo.txt")
(deftest file-error-pathname.2
(let ((c (make-condition 'file-error :pathname #p"foo.txt")))
(let ((c (make-condition 'file-error :pathname #p"scratch/foo.txt")))
(values
(notnot (typep c 'file-error))
(eqlt (class-of c) (find-class 'file-error))
(equalt #p"foo.txt" (file-error-pathname c))))
(equalt #p"scratch/foo.txt" (file-error-pathname c))))
t t t)
(deftest file-error-pathname.3
(let ((c (make-condition 'file-error :pathname "CLTEST:foo.txt")))
(let ((c (make-condition 'file-error :pathname "CLTEST:scratch/foo.txt")))
(values
(notnot (typep c 'file-error))
(eqlt (class-of c) (find-class 'file-error))
(equalpt "CLTEST:foo.txt"
(equalpt "CLTEST:scratch/foo.txt"
(file-error-pathname c))))
t t t)
(deftest file-error-pathname.4
(let ((c (make-condition 'file-error :pathname (logical-pathname "CLTEST:foo.txt"))))
(let ((c (make-condition
'file-error :pathname (logical-pathname "CLTEST:scratch/foo.txt"))))
(values
(notnot (typep c 'file-error))
(eqlt (class-of c) (find-class 'file-error))
(equalpt (logical-pathname "CLTEST:foo.txt")
(equalpt (logical-pathname "CLTEST:scratch/foo.txt")
(file-error-pathname c))))
t t t)
(deftest file-error-pathname.5
(with-open-file (s "file-error.lsp" :direction :input)
(with-open-file (s "sample-files/file-error.txt" :direction :input)
(let ((c (make-condition 'file-error :pathname s)))
(values
(notnot (typep c 'file-error))
......@@ -64,7 +65,7 @@
t t t)
(deftest file-error-pathname.6
(let ((s (open "file-error.lsp" :direction :input)))
(let ((s (open "sample-files/file-error.txt" :direction :input)))
(close s)
(let ((c (make-condition 'file-error :pathname s)))
(values
......@@ -79,11 +80,7 @@
(deftest file-error-pathname.error.2
(signals-error
(file-error-pathname (make-condition 'file-error :pathname "foo.txt") nil)
program-error)
t)
(file-error-pathname
(make-condition 'file-error :pathname "scratch/foo.txt")
nil)
program-error) t)
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Thu Jan 1 11:59:35 2004
;;;; Contains: Load tests of section 20, 'Files'
(let ((*default-pathname-defaults* (pathname *load-pathname*)))
(load "directory.lsp")
(load "probe-file.lsp")
(load "ensure-directories-exist.lsp")
(load "truename.lsp")
(load "file-author.lsp")
(load "file-write-date.lsp")
(load "rename-file.lsp")
(load "delete-file.lsp")
(load "file-error.lsp"))
......@@ -3,39 +3,37 @@
;;;; Created: Mon Jan 5 20:46:29 2004
;;;; Contains: Tests of PROBE-FILE
(deftest probe-file.1
(probe-file #p"nonexistent")
nil)
(deftest probe-file.2
(let ((s (open #p"probe-file.lsp" :direction :input)))
(let ((s (open #p"sample-files/probe-file.txt" :direction :input)))
(prog1
(equalpt (truename #p"probe-file.lsp")
(equalpt (truename #p"sample-files/probe-file.txt")
(probe-file s))
(close s)))
t)
(deftest probe-file.3
(let ((s (open #p"probe-file.lsp" :direction :input)))
(let ((s (open #p"sample-files/probe-file.txt" :direction :input)))
(close s)
(equalpt (truename #p"probe-file.lsp")
(equalpt (truename #p"sample-files/probe-file.txt")
(probe-file s)))
t)
(deftest probe-file.4
(equalpt (truename #p"probe-file.lsp")
(probe-file "CLTEST:probe-file.lsp"))
(equalpt (truename #p"sample-files/probe-file.txt")
(probe-file "CLTEST:sample-files/probe-file.txt"))
t)
;;; Specialized string tests
(deftest probe-file.5
(do-special-strings
(str "probe-file.lsp" nil)
(str "sample-files/probe-file.txt" nil)
(let ((s (open str :direction :input)))
(assert (equalpt (truename #p"probe-file.lsp") (probe-file s)))
(assert (equalpt (truename #p"sample-files/probe-file.txt") (probe-file s)))
(close s)))
nil)
......@@ -46,7 +44,7 @@
t)
(deftest probe-file.error.2
(signals-error (probe-file #p"probe-file.lsp" nil) program-error)
(signals-error (probe-file #p"sample-files/probe-file.txt" nil) program-error)
t)
(deftest probe-file.error.3
......
......@@ -6,8 +6,8 @@
(deftest rename-file.1
(let ((pn1 #p"file-to-be-renamed.txt")
(pn2 #p"file-that-was-renamed.txt"))
(let ((pn1 #p"scratch/file-to-be-renamed.txt")
(pn2 #p"scratch/file-that-was-renamed.txt"))
(delete-all-versions pn1)
(delete-all-versions pn2)
(with-open-file (s pn1 :direction :output) (format s "Whatever~%"))
......@@ -29,8 +29,8 @@
t nil t (t t t nil nil) t nil t)
(deftest rename-file.2
(let ((pn1 "file-to-be-renamed.txt")
(pn2 "file-that-was-renamed.txt"))
(let ((pn1 "scratch/file-to-be-renamed.txt")
(pn2 "scratch/file-that-was-renamed.txt"))
(delete-all-versions pn1)
(delete-all-versions pn2)
(with-open-file (s pn1 :direction :output) (format s "Whatever~%"))
......@@ -52,12 +52,12 @@
t nil t (t t t nil nil) t nil t)
(deftest rename-file.3
(let* ((pn1 (make-pathname :name "file-to-be-renamed"
(let* ((pn1 (make-pathname :name "scratch/file-to-be-renamed"
:type "txt"
:version :newest
:defaults *default-pathname-defaults*))
(pn2 (make-pathname :name "file-that-was-renamed"))
(pn3 (make-pathname :name "file-that-was-renamed"
(pn2 (make-pathname :name "scratch/file-that-was-renamed"))
(pn3 (make-pathname :name "scratch/file-that-was-renamed"
:defaults pn1)))
(delete-all-versions pn1)
(delete-all-versions pn3)
......@@ -82,8 +82,8 @@
t t nil t (t t t nil nil) t nil t)
(deftest rename-file.4
(let ((pn1 "file-to-be-renamed.txt")
(pn2 "file-that-was-renamed.txt"))
(let ((pn1 "scratch/file-to-be-renamed.txt")
(pn2 "scratch/file-that-was-renamed.txt"))
(delete-all-versions pn1)
(delete-all-versions pn2)
(let ((s (open pn1 :direction :output)))
......@@ -107,8 +107,8 @@
t nil t (t t t nil nil) t nil t)
(deftest rename-file.5
(let ((pn1 "CLTEST:file-to-be-renamed.txt")
(pn2 "CLTEST:file-that-was-renamed.txt"))
(let ((pn1 "CLTEST:scratch/file-to-be-renamed.txt")
(pn2 "CLTEST:scratch/file-that-was-renamed.txt"))
(delete-all-versions pn1)
(delete-all-versions pn2)
(assert (typep (pathname pn1) 'logical-pathname))
......@@ -137,9 +137,9 @@
(deftest rename-file.6
(do-special-strings
(s "file-to-be-renamed.txt" nil)
(s "scratch/file-to-be-renamed.txt" nil)
(let ((pn1 s)
(pn2 "file-that-was-renamed.txt"))
(pn2 "scratch/file-that-was-renamed.txt"))
(delete-all-versions pn1)
(delete-all-versions pn2)
(with-open-file (s pn1 :direction :output) (format s "Whatever~%"))
......@@ -165,8 +165,8 @@
(deftest rename-file.7
(do-special-strings
(s "file-that-was-renamed.txt" nil)
(let ((pn1 "file-to-be-renamed.txt")
(s "scratch/file-that-was-renamed.txt" nil)
(let ((pn1 "scratch/file-to-be-renamed.txt")
(pn2 s))
(delete-all-versions pn1)
(delete-all-versions pn2)
......
......@@ -6,7 +6,7 @@
(deftest truename.1
(let* ((pn #p"truename.lsp")
(let* ((pn #p"sample-files/truename.txt")
(tn (truename pn)))
(values
(notnot (pathnamep pn))
......@@ -17,7 +17,7 @@
t nil t t)
(deftest truename.2
(let* ((name "truename.lsp")
(let* ((name "sample-files/truename.txt")
(pn (pathname name))
(tn (truename name)))
(values
......@@ -29,7 +29,7 @@
t nil t t)
(deftest truename.3
(let* ((pn #p"truename.lsp"))
(let* ((pn #p"sample-files/truename.txt"))
(with-open-file
(s pn :direction :input)
(let ((tn (truename s)))
......@@ -42,7 +42,7 @@
t nil t t)
(deftest truename.4
(let* ((pn #p"truename.lsp"))
(let* ((pn #p"sample-files/truename.txt"))
(let ((s (open pn :direction :input)))
(close s)
(let ((tn (truename s)))
......@@ -55,7 +55,7 @@
t nil t t)
(deftest truename.5
(let* ((lpn "CLTEST:foo.txt")
(let* ((lpn "CLTEST:scratch/foo.txt")
(pn (translate-logical-pathname lpn)))
(unless (probe-file lpn)
(with-open-file (s lpn :direction :output) (format s "Stuff~%")))
......@@ -73,8 +73,8 @@
(deftest truename.6
(do-special-strings
(s "truename.lsp" nil)
(assert (equalp (truename s) (truename "truename.lsp"))))
(s "sample-files/truename.txt" nil)
(assert (equalp (truename s) (truename "sample-files/truename.txt"))))
nil)
;;; Error tests
......@@ -84,20 +84,22 @@
t)
(deftest truename.error.2
(signals-error (truename "truename.lsp" nil) program-error)
(signals-error (truename "sample-files/truename.txt" nil) program-error)
t)
(deftest truename.error.3
(signals-error-always (truename "nonexistent") file-error)
(signals-error-always (truename "sample-files/nonexistent") file-error)
t t)
(deftest truename.error.4
(signals-error-always (truename #p"nonexistent") file-error)
(signals-error-always (truename #p"sample-files/nonexistent") file-error)
t t)
(deftest truename.error.5
(signals-error-always (truename (logical-pathname "CLTESTROOT:nonexistent")) file-error)
t t)
(signals-error-always
(truename
(logical-pathname "CLTESTROOT:sample-files/nonexistent"))
file-error) t t)
(deftest truename.error.6
(signals-error-always
......
......@@ -136,7 +136,8 @@ rt_1000_8:
clean:
@rm -f auxiliary/*fas
@rm -f auxiliary/*.{out,fas,cls,fasl,o,so,~,fn,x86f,ufsl,abcl,lib}
@rm -f sample-files/*.{out,fas,cls,fasl,o,so,~,fn,x86f,ufsl,abcl,lib}x
@rm -f test*.out *.cls *.fasl *.o *.so *~ *.fn *.x86f *.fasl *.ufsl *.abcl *.fas *.lib \#*\#
@rm -f *.dfsl *.d64fsl
@(cd beyond-ansi; $(MAKE) clean)
......
;-*- Mode: Lisp -*-
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Sun Sep 12 06:21:42 2004
;;;; Contains: Tests for DIRECTORY-NAMESTRING
......@@ -6,22 +6,22 @@
(deftest directory-namestring.1
(let* ((vals (multiple-value-list
(directory-namestring "directory-namestring.lsp")))
(s (first vals)))
(if (and (null (cdr vals))
(stringp s)
(equal (directory-namestring s) s))
:good
vals))
(let* ((vals (multiple-value-list
(directory-namestring "sample-files/directory-namestring.txt")))
(s (first vals)))
(if (and (null (cdr vals))
(stringp s)
(equal (directory-namestring s) s))
:good
vals))
:good)
(deftest directory-namestring.2
(do-special-strings
(s "directory-namestring.lsp" nil)
(let ((ns (directory-namestring s)))
(assert (stringp ns))
(assert (string= (directory-namestring ns) ns))))
(do-special-strings
(s "sample-files/directory-namestring.txt" nil)
(let ((ns (directory-namestring s)))
(assert (stringp ns))
(assert (string= (directory-namestring ns) ns))))
nil)
;;; Lispworks makes another assumption about filename normalization
......@@ -31,20 +31,22 @@
;;; in which so much is left up to the implementation.)
#-lispworks
(deftest directory-namestring.3
(let* ((name "directory-namestring.lsp")
(pn (merge-pathnames (pathname name)))
(name2 (with-open-file (s pn :direction :input)
(directory-namestring s)))
(name3 (directory-namestring pn)))
(or (equalt name2 name3) (list name2 name3)))
(let* ((name "sample-files/directory-namestring.txt")
(pn (merge-pathnames (pathname name)))
(name2 (with-open-file (s pn :direction :input)
(directory-namestring s)))
(name3 (directory-namestring pn)))
(or (equalt name2 name3) (list name2 name3)))
t)
;;; Error tests
(deftest directory-namestring.error.1
(signals-error (directory-namestring) program-error)
(signals-error (directory-namestring) program-error)
t)
(deftest directory-namestring.error.2
(signals-error (directory-namestring "directory-namestring.lsp" nil) program-error)
(signals-error
(directory-namestring "sample-files/directory-namestring.txt" nil)
program-error)
t)
......@@ -6,25 +6,26 @@
(deftest enough-namestring.1
(let* ((vals (multiple-value-list (enough-namestring "enough-namestring.lsp")))
(s (first vals)))
(if (and (null (cdr vals))
(stringp s)
(equal (enough-namestring s) s))
:good
vals))
(let* ((vals (multiple-value-list
(enough-namestring "sample-files/enough-namestring.txt")))
(s (first vals)))
(if (and (null (cdr vals))
(stringp s)
(equal (enough-namestring s) s))
:good
vals))
:good)
(deftest enough-namestring.2
(do-special-strings
(s "enough-namestring.lsp" nil)
(s "sample-files/enough-namestring.txt" nil)
(let ((ns (enough-namestring s)))
(assert (stringp ns))
(assert (string= (enough-namestring ns) ns))))
nil)
(deftest enough-namestring.3
(let* ((name "enough-namestring.lsp")
(let* ((name "sample-files/enough-namestring.txt")
(pn (merge-pathnames (pathname name)))
(name2 (enough-namestring pn))
(name3 (enough-namestring name)))
......@@ -32,7 +33,7 @@
t)
(deftest enough-namestring.4
(let* ((name "enough-namestring.lsp")
(let* ((name "sample-files/enough-namestring.txt")
(pn (merge-pathnames (pathname name)))
(name2 (with-open-file (s pn :direction :input) (enough-namestring s)))
(name3 (enough-namestring name)))
......@@ -40,45 +41,49 @@
t)
(deftest enough-namestring.5
(let* ((vals (multiple-value-list (enough-namestring "enough-namestring.lsp"
*default-pathname-defaults*)))
(let* ((vals (multiple-value-list
(enough-namestring "sample-files/enough-namestring.txt"
*default-pathname-defaults*)))
(s (first vals)))
(if (and (null (cdr vals))
(stringp s)
(equal (enough-namestring s) s))
:good
vals))
vals))
:good)
(deftest enough-namestring.6
(let* ((vals (multiple-value-list (enough-namestring "enough-namestring.lsp"
(namestring *default-pathname-defaults*))))
(s (first vals)))
(if (and (null (cdr vals))
(stringp s)
(equal (enough-namestring s) s))
:good
vals))
(let* ((vals (multiple-value-list
(enough-namestring "sample-files/enough-namestring.txt"
(namestring *default-pathname-defaults*))))
(s (first vals)))
(if (and (null (cdr vals))
(stringp s)
(equal (enough-namestring s) s))
:good
vals))
:good)
(deftest enough-namestring.7
(do-special-strings
(s (namestring *default-pathname-defaults*) nil)
(let* ((vals (multiple-value-list (enough-namestring "enough-namestring.lsp" s)))
(s2 (first vals)))
(assert (null (cdr vals)))
(assert (stringp s2))
(assert (equal (enough-namestring s2) s2))))
(do-special-strings
(s (namestring *default-pathname-defaults*) nil)
(let* ((vals (multiple-value-list
(enough-namestring "sample-files/enough-namestring.txt" s)))
(s2 (first vals)))
(assert (null (cdr vals)))
(assert (stringp s2))
(assert (equal (enough-namestring s2) s2))))
nil)
;;; Error tests
(deftest enough-namestring.error.1
(signals-error (enough-namestring) program-error)
(signals-error (enough-namestring) program-error)
t)
(deftest enough-namestring.error.2
(signals-error
(enough-namestring "enough-namestring.lsp" *default-pathname-defaults* nil)
program-error)
(signals-error
(enough-namestring "sample-files/enough-namestring.txt"
*default-pathname-defaults* nil)
program-error)
t)
......@@ -4,39 +4,40 @@
;;;; Contains: Tests for FILE-NAMESTRING
(deftest file-namestring.1
(let* ((vals (multiple-value-list
(file-namestring "file-namestring.lsp")))
(s (first vals)))
(if (and (null (cdr vals))
(stringp s)
(equal (file-namestring s) s))
:good
vals))
(let* ((vals (multiple-value-list
(file-namestring "sample-files/file-namestring.txt")))
(s (first vals)))
(if (and (null (cdr vals))
(stringp s)
(equal (file-namestring s) s))
:good
vals))
:good)
(deftest file-namestring.2
(do-special-strings
(s "file-namestring.lsp" nil)
(let ((ns (file-namestring s)))
(assert (stringp ns))
(assert (string= (file-namestring ns) ns))))
(do-special-strings
(s "sample-files/file-namestring.txt" nil)
(let ((ns (file-namestring s)))
(assert (stringp ns))
(assert (string= (file-namestring ns) ns))))
nil)
(deftest file-namestring.3
(let* ((name "file-namestring.lsp")
(pn (merge-pathnames (pathname name)))
(name2 (with-open-file (s pn :direction :input)
(file-namestring s)))
(name3 (file-namestring pn)))
(or (equalt name2 name3) (list name2 name3)))
(let* ((name "sample-files/file-namestring.txt")
(pn (merge-pathnames (pathname name)))
(name2 (with-open-file (s pn :direction :input)
(file-namestring s)))
(name3 (file-namestring pn)))
(or (equalt name2 name3) (list name2 name3)))
t)
;;; Error tests
(deftest file-namestring.error.1
(signals-error (file-namestring) program-error)
(signals-error (file-namestring) program-error)
t)
(deftest file-namestring.error.2
(signals-error (file-namestring "file-namestring.lsp" nil) program-error)
(signals-error (file-namestring "sample-files/file-namestring.txt" nil)
program-error)
t)
......@@ -6,44 +6,44 @@
(deftest host-namestring.1
(let* ((vals (multiple-value-list
(host-namestring "host-namestring.lsp")))
(s (first vals)))
(if (and (null (cdr vals))
(or (null s)
(stringp s)
;; (equal (host-namestring s) s)
))
:good
vals))
(let* ((vals (multiple-value-list
(host-namestring "sample-files/host-namestring.txt")))