diff --git a/.gitignore b/.gitignore index 101dfe7a6a3427a7338ea5f3142f6f76ea9e5fc7..338bf853f655180d0e6971fa772a26d0b4863e2d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +*.out +*.dat *.fas ansi-aux-macros.fas ansi-aux.fas diff --git a/files/directory.lsp b/files/directory.lsp index 93ef9ab10336672b315d427ff655719d6411efcb..f603160688dbe941aa6f30ab57832a17a05cbe43 100644 --- a/files/directory.lsp +++ b/files/directory.lsp @@ -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) diff --git a/files/ensure-directories-exist.lsp b/files/ensure-directories-exist.lsp index 982e7d6668961d1f891350b05982add5f8e1a5bc..2809b59326e1368d0e8eb57dc24bfcdd97c865d5 100644 --- a/files/ensure-directories-exist.lsp +++ b/files/ensure-directories-exist.lsp @@ -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))) diff --git a/files/file-author.lsp b/files/file-author.lsp index 20c4fb3ad69508998c5d33af0d8739ac4fcf2975..d332ae345d5d3eaa1d1dcc0c2385c4db5e92a543 100644 --- a/files/file-author.lsp +++ b/files/file-author.lsp @@ -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) diff --git a/files/file-error.lsp b/files/file-error.lsp index 4bd5f5620e14519ebba6a8f1abdf4ab55919fe8b..8fe3b48eaa28d9e1b0420c39b5ac3bc310502f8b 100644 --- a/files/file-error.lsp +++ b/files/file-error.lsp @@ -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) diff --git a/files/load.lsp~ b/files/load.lsp~ deleted file mode 100644 index d7e0eb3baa6abf8c9f6f84e33c462f209a069f36..0000000000000000000000000000000000000000 --- a/files/load.lsp~ +++ /dev/null @@ -1,17 +0,0 @@ -;-*- 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")) diff --git a/files/probe-file.lsp b/files/probe-file.lsp index c4b8d7af1656c586a52c68eb6774fb22f4f00d19..6f5f1816e0f466746594127d32d4de0550c46ec0 100644 --- a/files/probe-file.lsp +++ b/files/probe-file.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 diff --git a/files/rename-file.lsp b/files/rename-file.lsp index 16a282ecc71b01614a4edb7d23d4b3b3ed6bf36f..7b2a2d6ae813ac0855995888317b54e6c6cb4920 100644 --- a/files/rename-file.lsp +++ b/files/rename-file.lsp @@ -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) diff --git a/files/truename.lsp b/files/truename.lsp index 3602b4dc55950140b28dc7826286b24d3d076472..17b4eca69cdab0d839c6a11c3018839deef12e08 100644 --- a/files/truename.lsp +++ b/files/truename.lsp @@ -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 diff --git a/makefile b/makefile index 3804e3a8c0b9b8baf3c2fffee28d719cb4c4f221..ffe01f27a8c1abb01b8a587e051a92d3e8672333 100644 --- a/makefile +++ b/makefile @@ -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) diff --git a/pathnames/directory-namestring.lsp b/pathnames/directory-namestring.lsp index f14e5300aa619abbf79d213c3de33a7520fc00ee..cb61d56712a243d09e070b3aaf5b3d8cbcd51880 100644 --- a/pathnames/directory-namestring.lsp +++ b/pathnames/directory-namestring.lsp @@ -1,4 +1,4 @@ -;-*- 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) diff --git a/pathnames/enough-namestring.lsp b/pathnames/enough-namestring.lsp index f40155268bfa76c805e6f52ab4912121c0aaea3b..3706cdf7fc0011e7ab5617b677c31f2c4db7abda 100644 --- a/pathnames/enough-namestring.lsp +++ b/pathnames/enough-namestring.lsp @@ -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) diff --git a/pathnames/file-namestring.lsp b/pathnames/file-namestring.lsp index 5a1051ba86f19658a58e8015a947ba8e70d8d2f0..9d543ac072ef4d2cda5932fb4a630865749dd2ef 100644 --- a/pathnames/file-namestring.lsp +++ b/pathnames/file-namestring.lsp @@ -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) diff --git a/pathnames/host-namestring.lsp b/pathnames/host-namestring.lsp index cb50b66984c6fd65be4dcd303586321affaee079..8b11e40ebaac47747603258bf482577ea6870302 100644 --- a/pathnames/host-namestring.lsp +++ b/pathnames/host-namestring.lsp @@ -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"))) + (s (first vals))) + (if (and (null (cdr vals)) + (or (null s) + (stringp s) + ;; (equal (host-namestring s) s) + )) + :good + vals)) :good) (deftest host-namestring.2 - (do-special-strings - (s "host-namestring.lsp" nil) - (let ((ns (host-namestring s))) - (when ns - (assert (stringp ns)) - ;; (assert (string= (host-namestring ns) ns)) - ))) + (do-special-strings + (s "sample-files/host-namestring.txt" nil) + (let ((ns (host-namestring s))) + (when ns + (assert (stringp ns)) + ;; (assert (string= (host-namestring ns) ns)) + ))) nil) (deftest host-namestring.3 - (let* ((name "host-namestring.lsp") - (pn (merge-pathnames (pathname name))) - (name2 (with-open-file (s pn :direction :input) - (host-namestring s))) - (name3 (host-namestring pn))) - (or (equalt name2 name3) (list name2 name3))) + (let* ((name "sample-files/host-namestring.txt") + (pn (merge-pathnames (pathname name))) + (name2 (with-open-file (s pn :direction :input) + (host-namestring s))) + (name3 (host-namestring pn))) + (or (equalt name2 name3) (list name2 name3))) t) ;;; Error tests (deftest host-namestring.error.1 - (signals-error (host-namestring) program-error) + (signals-error (host-namestring) program-error) t) (deftest host-namestring.error.2 - (signals-error (host-namestring "host-namestring.lsp" nil) program-error) + (signals-error (host-namestring "sample-files/host-namestring.txt" nil) + program-error) t) - diff --git a/pathnames/logical-pathname.lsp b/pathnames/logical-pathname.lsp index c5ae6e65670de9f8bbfffabcbacc623e121f90a3..1fb08c72b4432b69c596b8a37e81344400e380fb 100644 --- a/pathnames/logical-pathname.lsp +++ b/pathnames/logical-pathname.lsp @@ -38,7 +38,7 @@ (deftest logical-pathname.error.3 (signals-error - (with-open-file (s #p"logical-pathname.lsp" :direction :input) + (with-open-file (s #p"sample-files/logical-pathname.txt" :direction :input) (logical-pathname s)) type-error) t) diff --git a/pathnames/pathname.lsp b/pathnames/pathname.lsp index 13250a20b01d9e6be9c91759634550f18480c60f..a8c2d4b56b5d38e7757e8a787a842a76a6f4366f 100644 --- a/pathnames/pathname.lsp +++ b/pathnames/pathname.lsp @@ -1,79 +1,89 @@ -;-*- Mode: Lisp -*- + ;-*- Mode: Lisp -*- ;;;; Author: Paul Dietz ;;;; Created: Sat Nov 29 05:06:57 2003 ;;;; Contains: Tests of the function PATHNAME (deftest pathname.1 - (loop for x in *pathnames* - always (eq x (pathname x))) + (loop for x in *pathnames* + always (eq x (pathname x))) t) (deftest pathname.2 - (equalt #p"pathname.lsp" (pathname "pathname.lsp")) + (equalt #p"sample-files/pathname.txt" (pathname "sample-files/pathname.txt")) t) (deftest pathname.3 - (let ((s (open "pathname.lsp" :direction :input))) - (prog1 (equalt (truename (pathname s)) (truename #p"pathname.lsp")) - (close s))) + (let ((s (open "sample-files/pathname.txt" :direction :input))) + (prog1 (equalt (truename (pathname s)) + (truename #p"sample-files/pathname.txt")) + (close s))) t) (deftest pathname.4 - (let ((s (open "pathname.lsp" :direction :input))) - (close s) - (equalt (truename (pathname s)) (truename #p"pathname.lsp"))) + (let ((s (open "sample-files/pathname.txt" :direction :input))) + (close s) + (equalt (truename (pathname s)) + (truename #p"sample-files/pathname.txt"))) t) (deftest pathname.5 - (loop for x in *logical-pathnames* - always (eq x (pathname x))) + (loop for x in *logical-pathnames* + always (eq x (pathname x))) t) (deftest pathname.6 - (equalt #p"pathname.lsp" - (pathname (make-array 12 :initial-contents "pathname.lsp" - :element-type 'base-char))) + (equalt #p"sample-files/pathname.txt" + (pathname + (make-array 12 + :initial-contents "sample-files/pathname.txt" + :element-type 'base-char))) t) (deftest pathname.7 - (equalt #p"pathname.lsp" - (pathname (make-array 15 :initial-contents "pathname.lspXXX" - :element-type 'base-char - :fill-pointer 12))) + (equalt #p"sample-files/pathname.txt" + (pathname (make-array 15 + :initial-contents "sample-files/pathname.txtXXX" + :element-type 'base-char + :fill-pointer 12))) t) (deftest pathname.8 - (equalt #p"pathname.lsp" - (pathname (make-array 12 :initial-contents "pathname.lsp" - :element-type 'base-char - :adjustable t))) + (equalt #p"sample-files/pathname.txt" + (pathname (make-array 12 + :initial-contents "sample-files/pathname.txt" + :element-type 'base-char + :adjustable t))) t) (deftest pathname.9 - (equalt #p"pathname.lsp" - (pathname (make-array 15 :initial-contents "pathname.lspXXX" - :element-type 'character - :fill-pointer 12))) + (equalt #p"sample-files/pathname.txt" + (pathname (make-array 15 + :initial-contents "sample-files/pathname.txtXXX" + :element-type 'character + :fill-pointer 12))) t) (deftest pathname.10 - (equalt #p"pathname.lsp" - (pathname (make-array 12 :initial-contents "pathname.lsp" - :element-type 'character - :adjustable t))) + (equalt #p"sample-files/pathname.txt" + (pathname (make-array 12 + :initial-contents "sample-files/pathname.txt" + :element-type 'character + :adjustable t))) t) (deftest pathname.11 - (loop for etype in '(standard-char base-char character) - collect - (equalt #p"pathname.lsp" - (pathname - (let* ((s (make-array 15 :initial-contents "XXpathname.lspX" - :element-type etype))) - (make-array 12 :element-type etype - :displaced-to s - :displaced-index-offset 2))))) + (loop for etype in '(standard-char base-char character) + collect + (equalt #p"sample-files/pathname.txt" + (pathname + (let* ((s (make-array 15 + :initial-contents + "XXsample-files/pathname.txtX" + :element-type etype))) + (make-array 12 :element-type etype + :displaced-to s + :displaced-index-offset 2))))) (t t t)) ;;; Error tests diff --git a/printer/format/load.lsp~ b/printer/format/load.lsp~ deleted file mode 100644 index c908a196490962bbdce135569bcd8ae21ef9b8bc..0000000000000000000000000000000000000000 --- a/printer/format/load.lsp~ +++ /dev/null @@ -1,54 +0,0 @@ -;-*- Mode: Lisp -*- -;;;; Author: Paul Dietz -;;;; Created: Mon Aug 2 21:47:02 2004 -;;;; Contains: Load format-related tests - - - -;;; Format tests - -;;; 22.3.1 -(load "format/format-c.lsp") -(load "format/formatter-c.lsp") -(load "format/format-percent.lsp") -(load "format/format-ampersand.lsp") -(load "format/format-page.lsp") -(load "format/format-tilde.lsp") - -;;; 22.3.2 -(load "format/format-r.lsp") -(load "format/format-d.lsp") -(load "format/format-b.lsp") -(load "format/format-o.lsp") -(load "format/format-x.lsp") - -;;; 22.3.3 -(load "format/format-f.lsp") - -;;; 22.3.4 -(load "format/format-a.lsp") -(load "format/format-s.lsp") - -;;; 22.3.5 -(load "format/format-underscore.lsp") -(load "format/format-logical-block.lsp") -(load "format/format-i.lsp") -(load "format/format-slash.lsp") - -;;; 22.3.6 -(load "format/format-t.lsp") -(load "format/format-justify.lsp") - -;;; 22.3.7 -(load "format/format-goto.lsp") -(load "format/format-conditional.lsp") -(load "format/format-brace.lsp") -(load "format/format-question.lsp") - -;;; 22.3.8 -(load "format/format-paren.lsp") -(load "format/format-p.lsp") - -;;; 22.3.9 -(load "format/format-circumflex.lsp") -(load "format/format-newline.lsp") diff --git a/sample-files/class-precedence-lists.txt b/sample-files/class-precedence-lists.txt new file mode 100644 index 0000000000000000000000000000000000000000..df11b507fd0879a2727faf3f6e77c483296c17d0 --- /dev/null +++ b/sample-files/class-precedence-lists.txt @@ -0,0 +1,2 @@ +xxx +yyy diff --git a/system-construction/compile-file-test-file-2.lsp b/sample-files/compile-file-test-file-2.lsp similarity index 100% rename from system-construction/compile-file-test-file-2.lsp rename to sample-files/compile-file-test-file-2.lsp diff --git a/system-construction/compile-file-test-file-2a.lsp b/sample-files/compile-file-test-file-2a.lsp similarity index 100% rename from system-construction/compile-file-test-file-2a.lsp rename to sample-files/compile-file-test-file-2a.lsp diff --git a/system-construction/compile-file-test-file-3.lsp b/sample-files/compile-file-test-file-3.lsp similarity index 100% rename from system-construction/compile-file-test-file-3.lsp rename to sample-files/compile-file-test-file-3.lsp diff --git a/system-construction/compile-file-test-file-4.lsp b/sample-files/compile-file-test-file-4.lsp similarity index 100% rename from system-construction/compile-file-test-file-4.lsp rename to sample-files/compile-file-test-file-4.lsp diff --git a/system-construction/compile-file-test-file-5.lsp b/sample-files/compile-file-test-file-5.lsp similarity index 100% rename from system-construction/compile-file-test-file-5.lsp rename to sample-files/compile-file-test-file-5.lsp diff --git a/system-construction/compile-file-test-file.lsp b/sample-files/compile-file-test-file.lsp similarity index 100% rename from system-construction/compile-file-test-file.lsp rename to sample-files/compile-file-test-file.lsp diff --git a/sample-files/enough-namestring.txt b/sample-files/enough-namestring.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/sample-files/ensure-directories-exist.txt b/sample-files/ensure-directories-exist.txt new file mode 100644 index 0000000000000000000000000000000000000000..d6459e005434a49a66a3ddec92279a86160ad71f --- /dev/null +++ b/sample-files/ensure-directories-exist.txt @@ -0,0 +1 @@ +xxx diff --git a/sample-files/file-author.txt b/sample-files/file-author.txt new file mode 100644 index 0000000000000000000000000000000000000000..d6459e005434a49a66a3ddec92279a86160ad71f --- /dev/null +++ b/sample-files/file-author.txt @@ -0,0 +1 @@ +xxx diff --git a/sample-files/file-error.txt b/sample-files/file-error.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/sample-files/file-length.txt b/sample-files/file-length.txt new file mode 100644 index 0000000000000000000000000000000000000000..d6459e005434a49a66a3ddec92279a86160ad71f --- /dev/null +++ b/sample-files/file-length.txt @@ -0,0 +1 @@ +xxx diff --git a/sample-files/file-namestring.txt b/sample-files/file-namestring.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/sample-files/file-position.txt b/sample-files/file-position.txt new file mode 100644 index 0000000000000000000000000000000000000000..4fb7365b68a15275af30986fd2e4d2fdfd121c60 --- /dev/null +++ b/sample-files/file-position.txt @@ -0,0 +1,2 @@ +;xxx + diff --git a/sample-files/host-namestring.txt b/sample-files/host-namestring.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/sample-files/listen.txt b/sample-files/listen.txt new file mode 100644 index 0000000000000000000000000000000000000000..d6459e005434a49a66a3ddec92279a86160ad71f --- /dev/null +++ b/sample-files/listen.txt @@ -0,0 +1 @@ +xxx diff --git a/system-construction/load-test-file-2.lsp b/sample-files/load-test-file-2.lsp similarity index 100% rename from system-construction/load-test-file-2.lsp rename to sample-files/load-test-file-2.lsp diff --git a/system-construction/load-test-file.lsp b/sample-files/load-test-file.lsp similarity index 100% rename from system-construction/load-test-file.lsp rename to sample-files/load-test-file.lsp diff --git a/sample-files/logical-pathname.txt b/sample-files/logical-pathname.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/system-construction/modules7.lsp b/sample-files/modules7.lsp similarity index 100% rename from system-construction/modules7.lsp rename to sample-files/modules7.lsp diff --git a/system-construction/modules8a.lsp b/sample-files/modules8a.lsp similarity index 100% rename from system-construction/modules8a.lsp rename to sample-files/modules8a.lsp diff --git a/system-construction/modules8b.lsp b/sample-files/modules8b.lsp similarity index 100% rename from system-construction/modules8b.lsp rename to sample-files/modules8b.lsp diff --git a/sample-files/pathname.txt b/sample-files/pathname.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/sample-files/probe-file.txt b/sample-files/probe-file.txt new file mode 100644 index 0000000000000000000000000000000000000000..d6459e005434a49a66a3ddec92279a86160ad71f --- /dev/null +++ b/sample-files/probe-file.txt @@ -0,0 +1 @@ +xxx diff --git a/sample-files/truename.txt b/sample-files/truename.txt new file mode 100644 index 0000000000000000000000000000000000000000..d6459e005434a49a66a3ddec92279a86160ad71f --- /dev/null +++ b/sample-files/truename.txt @@ -0,0 +1 @@ +xxx diff --git a/streams/file-length.lsp b/streams/file-length.lsp index b3e2ba0708a06e9d6c18bcce4e1a4e117028bef8..eccc5649e9b1bc67e34b72c6db3bae4dfe2cab92 100644 --- a/streams/file-length.lsp +++ b/streams/file-length.lsp @@ -11,7 +11,7 @@ (deftest file-length.error.2 (signals-error - (with-open-file (is "file-length.lsp" :direction :input) + (with-open-file (is "sample-files/file-length.txt" :direction :input) (file-length is nil)) program-error) t) @@ -37,7 +37,7 @@ (deftest file-length.error.5 (signals-error (with-open-file - (is "file-length.lsp" :direction :input) + (is "sample-files/file-length.txt" :direction :input) (with-open-file (os "tmp.txt" :direction :output :if-exists :supersede) (let ((s (make-two-way-stream is os))) @@ -48,7 +48,7 @@ (deftest file-length.error.6 (signals-error (with-open-file - (is "file-length.lsp" :direction :input) + (is "sample-files/file-length.txt" :direction :input) (with-open-file (os "tmp.txt" :direction :output :if-exists :supersede) (let ((s (make-echo-stream is os))) @@ -71,7 +71,7 @@ (deftest file-length.error.10 (signals-error (with-open-file - (is "file-length.lsp" :direction :input) + (is "sample-files/file-length.txt" :direction :input) (let ((s (make-concatenated-stream is))) (unwind-protect (file-length s) (close s)))) type-error) @@ -94,7 +94,7 @@ (deftest file-length.1 (let ((results (multiple-value-list (with-open-file - (is "file-length.lsp" :direction :input) + (is "sample-files/file-length.txt" :direction :input) (file-length is))))) (and (= (length results) 1) (typep (car results) '(integer 1)) @@ -167,7 +167,7 @@ (deftest file-length.6 (with-open-file - (*foo* "file-length.lsp" :direction :input) + (*foo* "sample-files/file-length.txt" :direction :input) (declare (special *foo*)) (let ((s (make-synonym-stream '*foo*))) (unwind-protect diff --git a/streams/file-position.lsp b/streams/file-position.lsp index 3aa3c87e61ca9d3310a0b7c4534486c559df0993..0b57fb54027a8239c387d292278c67a05bf3e728 100644 --- a/streams/file-position.lsp +++ b/streams/file-position.lsp @@ -6,12 +6,12 @@ (in-package :cl-test) (deftest file-position.1 - (with-open-file (is "file-position.lsp":direction :input) + (with-open-file (is "sample-files/file-position.txt":direction :input) (file-position is)) 0) (deftest file-position.2 - (with-open-file (is "file-position.lsp":direction :input) + (with-open-file (is "sample-files/file-position.txt":direction :input) (values (multiple-value-list (notnot-mv (file-position is :start))) @@ -20,7 +20,7 @@ (t) 0) (deftest file-position.3 - (with-open-file (is "file-position.lsp":direction :input) + (with-open-file (is "sample-files/file-position.txt":direction :input) (values (multiple-value-list (notnot-mv (file-position is :end))) @@ -29,7 +29,7 @@ (deftest file-position.4 (with-open-file - (is "file-position.lsp":direction :input) + (is "sample-files/file-position.txt":direction :input) (values (file-position is) (read-char is) @@ -149,7 +149,7 @@ (deftest file-position.error.3 (signals-error (with-open-file - (is "file-position.lsp" :direction :input) + (is "sample-files/file-position.txt" :direction :input) (flet ((%fail () (error 'type-error))) (unless (file-position is :end) (%fail)) (let ((fp (file-position is))) @@ -161,7 +161,7 @@ (deftest file-position.error.4 (signals-error (with-open-file - (is "file-position.lsp" :direction :input) + (is "sample-files/file-position.txt" :direction :input) (file-position is 1000000000000000000000)) error) t) diff --git a/streams/listen.lsp b/streams/listen.lsp index 7e9b8eab014a8cbf94c2f1a09364c827e9b4695e..fce4d16553d1a51e05eae4620b5e1c81f6198750 100644 --- a/streams/listen.lsp +++ b/streams/listen.lsp @@ -39,7 +39,7 @@ (deftest listen.7 (with-open-file - (s "listen.lsp") + (s "sample-files/listen.txt") (values (notnot (listen s)) (handler-case diff --git a/system-construction/compile-file.lsp b/system-construction/compile-file.lsp index 855ef2732dd7e273de8bf25a3afef107c2d6e214..d0e276a9223daee9435cf2bd88e7432f89f09e96 100644 --- a/system-construction/compile-file.lsp +++ b/system-construction/compile-file.lsp @@ -64,76 +64,86 @@ (funcall funname))))))) (deftest compile-file.1 - (compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1) - t nil) + (compile-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1) t nil) (deftest compile-file.2 - (compile-file-test "compile-file-test-file-2.lsp" 'compile-file-test-fun.2 + (compile-file-test "sample-files/compile-file-test-file-2.lsp" + 'compile-file-test-fun.2 :expect-style-warnings t) t nil) (deftest compile-file.2a - (compile-file-test "compile-file-test-file-2a.lsp" 'compile-file-test-fun.2a + (compile-file-test "sample-files/compile-file-test-file-2a.lsp" + 'compile-file-test-fun.2a :expect-warnings t) t nil) (deftest compile-file.3 (let ((*package* (find-package "CL-TEST"))) - (compile-file-test "compile-file-test-file-3.lsp" 'compile-file-test-fun.3)) - t nil) + (compile-file-test "sample-files/compile-file-test-file-3.lsp" + 'compile-file-test-fun.3)) t nil) (deftest compile-file.4 (let ((*package* (find-package "CL-USER"))) - (compile-file-test "compile-file-test-file-3.lsp" 'cl-user::compile-file-test-fun.3)) - t nil) + (compile-file-test "sample-files/compile-file-test-file-3.lsp" + 'cl-user::compile-file-test-fun.3)) t nil) (deftest compile-file.5 - (compile-file-test #p"compile-file-test-file.lsp" 'compile-file-test-fun.1) - t nil) + (compile-file-test #p"sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1) t nil) (deftest compile-file.6 - (compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (compile-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :output-file "foo.fasl") t nil) (deftest compile-file.6a - (compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (compile-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :output-file "foo.ufsl") t nil) (deftest compile-file.7 - (compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (compile-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :external-format :default) t nil) (deftest compile-file.8 - (compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (compile-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :output-file #p"foo.fasl") t nil) (deftest compile-file.9 - (compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (compile-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :print t) t nil) (deftest compile-file.10 - (compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (compile-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :verbose t) t nil) (deftest compile-file.11 - (compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (compile-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :print nil) t nil) (deftest compile-file.12 - (compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (compile-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :verbose nil) t nil) ;;; A file stream is a pathname designator (deftest compile-file.13 - (with-open-file (s "compile-file-test-file.lsp" :direction :input) + (with-open-file (s "sample-files/compile-file-test-file.lsp" :direction :input) (compile-file-test s 'compile-file-test-fun.1)) t nil) @@ -141,7 +151,7 @@ (let ((s (open "foo.fasl" :direction :output :if-exists :supersede :if-does-not-exist :create))) (close s) - (compile-file-test "compile-file-test-file.lsp" + (compile-file-test "sample-files/compile-file-test-file.lsp" 'compile-file-test-fun.1 :output-file s)) t nil) @@ -149,13 +159,13 @@ (deftest compile-file.15 (let ((*readtable* (copy-readtable nil))) (set-macro-character #\! (get-macro-character #\')) - (compile-file-test "compile-file-test-file-4.lsp" 'compile-file-test-fun.4)) - t foo) + (compile-file-test "sample-files/compile-file-test-file-4.lsp" + 'compile-file-test-fun.4)) t foo) ;;; Tests for *compile-file-truename*, *compile-file-pathname* (deftest compile-file.16 - (let* ((file #p"compile-file-test-file-5.lsp") + (let* ((file #p"sample-files/compile-file-test-file-5.lsp") (target-pathname (compile-file-pathname file)) (*compile-print* nil) (*compile-verbose* nil)) @@ -183,18 +193,20 @@ (let ((file (logical-pathname "CLTEST:COMPILE-FILE-TEST-LP.OUT"))) (with-open-file (s file :direction :output :if-exists :supersede :if-does-not-exist :create)) - (compile-file-test "compile-file-test-file.lsp" + (compile-file-test "sample-files/compile-file-test-file.lsp" 'compile-file-test-fun.1 :output-file file)) t nil) (deftest compile-file.19 - (compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (compile-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :*compile-verbose* t) t nil) (deftest compile-file.20 - (compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (compile-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :*compile-print* t) t nil) @@ -209,8 +221,8 @@ ;;; Error cases (deftest compile-file.error.1 - (signals-error (compile-file "nonexistent-file-to-compile.lsp") file-error) - t) + (signals-error (compile-file "sample-files/nonexistent-file-to-compile.lsp") + file-error) t) (deftest compile-file.error.2 (signals-error (compile-file) program-error) diff --git a/system-construction/load-file.lsp b/system-construction/load-file.lsp index 801ca6d08cc7c48b3f5a6846565e8a9a792b510d..09627e5ae7062fea1bf2a5ce9b2f9f906f513b2c 100644 --- a/system-construction/load-file.lsp +++ b/system-construction/load-file.lsp @@ -36,12 +36,12 @@ (funcall funname)))) (deftest load.1 - (load-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1) - t nil) + (load-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1) t nil) (deftest load.2 - (load-file-test #p"compile-file-test-file.lsp" 'compile-file-test-fun.1) - t nil) + (load-file-test #p"sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1) t nil) (deftest load.3 (with-input-from-string @@ -50,22 +50,26 @@ t good) (deftest load.4 - (load-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (load-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :external-format :default) t nil) (deftest load.5 - (load-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (load-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :verbose t) t nil) (deftest load.6 - (load-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (load-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :*load-verbose* t) t nil) (deftest load.7 - (load-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (load-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :*load-verbose* t :verbose nil) t nil) @@ -76,22 +80,26 @@ t good) (deftest load.9 - (load-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (load-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :print t) t nil) (deftest load.10 - (load-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (load-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :*load-print* t) t nil) (deftest load.11 - (load-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (load-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :*load-print* t :print nil) t nil) (deftest load.12 - (load-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1 + (load-file-test "sample-files/compile-file-test-file.lsp" + 'compile-file-test-fun.1 :*load-print* nil :print t) t nil) @@ -102,7 +110,7 @@ t good) (deftest load.14 - (load "nonexistent-file.lsp" :if-does-not-exist nil) + (load "sample-files/nonexistent-file.lsp" :if-does-not-exist nil) nil) (defpackage LOAD-TEST-PACKAGE (:use "COMMON-LISP")) @@ -148,7 +156,7 @@ (t good) !FOO) (deftest load.17 - (let ((file #p"load-test-file.lsp")) + (let ((file #p"sample-files/load-test-file.lsp")) (fmakunbound 'load-file-test-fun.1) (fmakunbound 'load-file-test-fun.2) (values @@ -165,7 +173,7 @@ ;;; properly when loading compiled files (deftest load.18 - (let* ((file "load-test-file-2.lsp") + (let* ((file "sample-files/load-test-file-2.lsp") (target (enough-namestring (compile-file-pathname file)))) (declare (special *load-test-var.1* *load-test-var.2*)) (compile-file file) @@ -212,14 +220,13 @@ ;;; Error tests (deftest load.error.1 - (signals-error (load "nonexistent-file.lsp") file-error) - t) + (signals-error (load "sample-files/nonexistent-file.lsp") + file-error) t) (deftest load.error.2 (signals-error (load) program-error) t) (deftest load.error.3 - (signals-error (load "compile-file-test-file.lsp" :bad-key-arg t) - program-error) - t) + (signals-error (load "sample-files/compile-file-test-file.lsp" :bad-key-arg + t) program-error) t) diff --git a/system-construction/modules.lsp b/system-construction/modules.lsp index a9bb5b29f0d8c0c7e39853acadff280ff4a0ac7e..9e66d42f16db3a6a851072e872379b0797df5cd2 100644 --- a/system-construction/modules.lsp +++ b/system-construction/modules.lsp @@ -44,7 +44,7 @@ (let ((*modules* *modules*) (fn 'modules7-fun)) (when (fboundp fn) (fmakunbound fn)) - (require "MODULES-7" #p"modules7.lsp") + (require "MODULES-7" #p"sample-files/modules7.lsp") (funcall fn)) :good) @@ -53,7 +53,8 @@ (fns '(modules8a-fun modules8b-fun))) (dolist (fn fns) (when (fboundp fn) (fmakunbound fn))) - (require "MODULES-8" '(#p"modules8a.lsp" #p"modules8b.lsp")) + (require "MODULES-8" '(#p"sample-files/modules8a.lsp" + #p"sample-files/modules8b.lsp")) (mapcar #'funcall fns)) (:good :also-good)) diff --git a/types-and-classes/class-precedence-lists.lsp b/types-and-classes/class-precedence-lists.lsp index 6d3e78876e163f04ffaa4bf3651f5790dd0b7ea5..d669ac762d6a083719cfa64c3670decb615499cc 100644 --- a/types-and-classes/class-precedence-lists.lsp +++ b/types-and-classes/class-precedence-lists.lsp @@ -97,7 +97,7 @@ (make-echo-stream (make-string-input-stream "foo") out)) (echo-stream stream t)) -(def-cpl-test (open "class-precedence-lists.lsp" :direction :probe) +(def-cpl-test (open "sample-files/class-precedence-lists.txt" :direction :probe) (file-stream stream t)) (def-cpl-test 1.0s0 (float real number t) float-cpl.1)