Commit 115226ae authored by Daniel Kochmański's avatar Daniel Kochmański

restructure: done?

Signed-off-by: Daniel Kochmański's avatarDaniel Kochmański <daniel@turtleware.eu>
parent fac03ad2
...@@ -51,9 +51,11 @@ ...@@ -51,9 +51,11 @@
nil) nil)
(deftest directory.8 (deftest directory.8
(let* ((pathname-pattern "CLTEST:*.*") ;; what does this test do? Checks if we have >= then 30 files?
(len (length (directory pathname-pattern)))) ;; seems bogus to me -- jd
(if (< len 500) len nil)) (let* ((pathname-pattern "CLTEST:*.*")
(len (length (directory pathname-pattern))))
(if (< len 30) len nil))
nil) nil)
;;; Specialized string tests ;;; Specialized string tests
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
(deftest file-write-date.1 (deftest file-write-date.1
(let* ((pn "file-write-date.lsp") (let* ((pn "sample-files/file-write-date.txt")
(date (file-write-date pn)) (date (file-write-date pn))
(time (get-universal-time))) (time (get-universal-time)))
(or (null date) (or (null date)
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
t) t)
(deftest file-write-date.2 (deftest file-write-date.2
(let* ((pn #p"file-write-date.lsp") (let* ((pn #p"sample-files/file-write-date.txt")
(date (file-write-date pn)) (date (file-write-date pn))
(time (get-universal-time))) (time (get-universal-time)))
(or (null date) (or (null date)
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
t) t)
(deftest file-write-date.3 (deftest file-write-date.3
(let* ((pn (truename "file-write-date.lsp")) (let* ((pn (truename "sample-files/file-write-date.txt"))
(date (file-write-date pn)) (date (file-write-date pn))
(time (get-universal-time))) (time (get-universal-time)))
(or (null date) (or (null date)
...@@ -47,13 +47,13 @@ ...@@ -47,13 +47,13 @@
nil) nil)
(deftest file-write-date.5 (deftest file-write-date.5
(length (multiple-value-list (file-write-date "file-write-date.lsp"))) (length (multiple-value-list (file-write-date "sample-files/file-write-date.txt")))
1) 1)
;;; Specialized string tests ;;; Specialized string tests
(deftest file-write-date.6 (deftest file-write-date.6
(let* ((str "file-write-date.lsp") (let* ((str "sample-files/file-write-date.txt")
(date (file-write-date str))) (date (file-write-date str)))
(do-special-strings (do-special-strings
(s str nil) (s str nil)
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
t) t)
(deftest file-write-date.error.2 (deftest file-write-date.error.2
(signals-error (file-write-date "file-write-date.lsp" nil) (signals-error (file-write-date "sample-files/file-write-date.txt" nil)
program-error) program-error)
t) t)
......
...@@ -8,32 +8,32 @@ ...@@ -8,32 +8,32 @@
nil) nil)
(deftest probe-file.2 (deftest probe-file.2
(let ((s (open #p"sample-files/probe-file.txt" :direction :input))) (let ((s (open #p"probe-file.txt" :direction :input)))
(prog1 (prog1
(equalpt (truename #p"sample-files/probe-file.txt") (equalpt (truename #p"probe-file.txt")
(probe-file s)) (probe-file s))
(close s))) (close s)))
t) t)
(deftest probe-file.3 (deftest probe-file.3
(let ((s (open #p"sample-files/probe-file.txt" :direction :input))) (let ((s (open #p"probe-file.txt" :direction :input)))
(close s) (close s)
(equalpt (truename #p"sample-files/probe-file.txt") (equalpt (truename #p"probe-file.txt")
(probe-file s))) (probe-file s)))
t) t)
(deftest probe-file.4 (deftest probe-file.4
(equalpt (truename #p"sample-files/probe-file.txt") (equalpt (truename #p"probe-file.txt")
(probe-file "CLTEST:sample-files/probe-file.txt")) (probe-file "CLTEST:probe-file.txt"))
t) t)
;;; Specialized string tests ;;; Specialized string tests
(deftest probe-file.5 (deftest probe-file.5
(do-special-strings (do-special-strings
(str "sample-files/probe-file.txt" nil) (str "probe-file.txt" nil)
(let ((s (open str :direction :input))) (let ((s (open str :direction :input)))
(assert (equalpt (truename #p"sample-files/probe-file.txt") (probe-file s))) (assert (equalpt (truename #p"probe-file.txt") (probe-file s)))
(close s))) (close s)))
nil) nil)
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
t) t)
(deftest probe-file.error.2 (deftest probe-file.error.2
(signals-error (probe-file #p"sample-files/probe-file.txt" nil) program-error) (signals-error (probe-file #p"probe-file.txt" nil) program-error)
t) t)
(deftest probe-file.error.3 (deftest probe-file.error.3
......
...@@ -3,11 +3,9 @@ ...@@ -3,11 +3,9 @@
;;;; Created: Thu Jan 8 06:22:53 2004 ;;;; Created: Thu Jan 8 06:22:53 2004
;;;; Contains: Tests for RENAME-FILE ;;;; Contains: Tests for RENAME-FILE
(deftest rename-file.1 (deftest rename-file.1
(let ((pn1 #p"scratch/file-to-be-renamed.txt") (let ((pn1 #p"file-to-be-renamed.txt")
(pn2 #p"scratch/file-that-was-renamed.txt")) (pn2 #p"file-that-was-renamed.txt"))
(delete-all-versions pn1) (delete-all-versions pn1)
(delete-all-versions pn2) (delete-all-versions pn2)
(with-open-file (s pn1 :direction :output) (format s "Whatever~%")) (with-open-file (s pn1 :direction :output) (format s "Whatever~%"))
...@@ -29,8 +27,8 @@ ...@@ -29,8 +27,8 @@
t nil t (t t t nil nil) t nil t) t nil t (t t t nil nil) t nil t)
(deftest rename-file.2 (deftest rename-file.2
(let ((pn1 "scratch/file-to-be-renamed.txt") (let ((pn1 "file-to-be-renamed.txt")
(pn2 "scratch/file-that-was-renamed.txt")) (pn2 "file-that-was-renamed.txt"))
(delete-all-versions pn1) (delete-all-versions pn1)
(delete-all-versions pn2) (delete-all-versions pn2)
(with-open-file (s pn1 :direction :output) (format s "Whatever~%")) (with-open-file (s pn1 :direction :output) (format s "Whatever~%"))
...@@ -52,12 +50,12 @@ ...@@ -52,12 +50,12 @@
t nil t (t t t nil nil) t nil t) t nil t (t t t nil nil) t nil t)
(deftest rename-file.3 (deftest rename-file.3
(let* ((pn1 (make-pathname :name "scratch/file-to-be-renamed" (let* ((pn1 (make-pathname :name "file-to-be-renamed"
:type "txt" :type "txt"
:version :newest :version :newest
:defaults *default-pathname-defaults*)) :defaults *default-pathname-defaults*))
(pn2 (make-pathname :name "scratch/file-that-was-renamed")) (pn2 (make-pathname :name "file-that-was-renamed"))
(pn3 (make-pathname :name "scratch/file-that-was-renamed" (pn3 (make-pathname :name "file-that-was-renamed"
:defaults pn1))) :defaults pn1)))
(delete-all-versions pn1) (delete-all-versions pn1)
(delete-all-versions pn3) (delete-all-versions pn3)
...@@ -82,8 +80,8 @@ ...@@ -82,8 +80,8 @@
t t nil t (t t t nil nil) t nil t) t t nil t (t t t nil nil) t nil t)
(deftest rename-file.4 (deftest rename-file.4
(let ((pn1 "scratch/file-to-be-renamed.txt") (let ((pn1 "file-to-be-renamed.txt")
(pn2 "scratch/file-that-was-renamed.txt")) (pn2 "file-that-was-renamed.txt"))
(delete-all-versions pn1) (delete-all-versions pn1)
(delete-all-versions pn2) (delete-all-versions pn2)
(let ((s (open pn1 :direction :output))) (let ((s (open pn1 :direction :output)))
...@@ -107,8 +105,8 @@ ...@@ -107,8 +105,8 @@
t nil t (t t t nil nil) t nil t) t nil t (t t t nil nil) t nil t)
(deftest rename-file.5 (deftest rename-file.5
(let ((pn1 "CLTEST:scratch/file-to-be-renamed.txt") (let ((pn1 "CLTEST:file-to-be-renamed.txt")
(pn2 "CLTEST:scratch/file-that-was-renamed.txt")) (pn2 "CLTEST:file-that-was-renamed.txt"))
(delete-all-versions pn1) (delete-all-versions pn1)
(delete-all-versions pn2) (delete-all-versions pn2)
(assert (typep (pathname pn1) 'logical-pathname)) (assert (typep (pathname pn1) 'logical-pathname))
...@@ -137,9 +135,9 @@ ...@@ -137,9 +135,9 @@
(deftest rename-file.6 (deftest rename-file.6
(do-special-strings (do-special-strings
(s "scratch/file-to-be-renamed.txt" nil) (s "file-to-be-renamed.txt" nil)
(let ((pn1 s) (let ((pn1 s)
(pn2 "scratch/file-that-was-renamed.txt")) (pn2 "file-that-was-renamed.txt"))
(delete-all-versions pn1) (delete-all-versions pn1)
(delete-all-versions pn2) (delete-all-versions pn2)
(with-open-file (s pn1 :direction :output) (format s "Whatever~%")) (with-open-file (s pn1 :direction :output) (format s "Whatever~%"))
...@@ -165,8 +163,8 @@ ...@@ -165,8 +163,8 @@
(deftest rename-file.7 (deftest rename-file.7
(do-special-strings (do-special-strings
(s "scratch/file-that-was-renamed.txt" nil) (s "file-that-was-renamed.txt" nil)
(let ((pn1 "scratch/file-to-be-renamed.txt") (let ((pn1 "file-to-be-renamed.txt")
(pn2 s)) (pn2 s))
(delete-all-versions pn1) (delete-all-versions pn1)
(delete-all-versions pn2) (delete-all-versions pn2)
......
#+ecl (si::package-lock (find-package "COMMON-LISP") nil) #+ecl (si::package-lock (find-package "COMMON-LISP") nil)
#+ecl (compile nil '(lambda () nil)) #+ecl (compile nil '(lambda () nil))
#+ecl (setq c:*suppress-compiler-warnings* t c:*suppress-compiler-notes* t) #+ecl (setq c:*suppress-compiler-warnings* t
c:*suppress-compiler-notes* t
c:*suppress-compiler-messages* t)
#+:armedbear (require 'pprint) #+:armedbear (require 'pprint)
#+cmu (setq ext:*gc-verbose* nil) #+cmu (setq ext:*gc-verbose* nil)
#+gcl (setq compiler:*suppress-compiler-notes* t #+gcl (setq compiler:*suppress-compiler-notes* t
......
...@@ -35,22 +35,22 @@ ...@@ -35,22 +35,22 @@
(deftest pathname.6 (deftest pathname.6
(equalt #p"sample-files/pathname.txt" (equalt #p"sample-files/pathname.txt"
(pathname (pathname
(make-array 12 (make-array 25
:initial-contents "sample-files/pathname.txt" :initial-contents "sample-files/pathname.txt"
:element-type 'base-char))) :element-type 'base-char)))
t) t)
(deftest pathname.7 (deftest pathname.7
(equalt #p"sample-files/pathname.txt" (equalt #p"sample-files/pathname.txt"
(pathname (make-array 15 (pathname (make-array 28
:initial-contents "sample-files/pathname.txtXXX" :initial-contents "sample-files/pathname.txtXXX"
:element-type 'base-char :element-type 'base-char
:fill-pointer 12))) :fill-pointer 25)))
t) t)
(deftest pathname.8 (deftest pathname.8
(equalt #p"sample-files/pathname.txt" (equalt #p"sample-files/pathname.txt"
(pathname (make-array 12 (pathname (make-array 25
:initial-contents "sample-files/pathname.txt" :initial-contents "sample-files/pathname.txt"
:element-type 'base-char :element-type 'base-char
:adjustable t))) :adjustable t)))
...@@ -58,15 +58,15 @@ ...@@ -58,15 +58,15 @@
(deftest pathname.9 (deftest pathname.9
(equalt #p"sample-files/pathname.txt" (equalt #p"sample-files/pathname.txt"
(pathname (make-array 15 (pathname (make-array 28
:initial-contents "sample-files/pathname.txtXXX" :initial-contents "sample-files/pathname.txtXXX"
:element-type 'character :element-type 'character
:fill-pointer 12))) :fill-pointer 25)))
t) t)
(deftest pathname.10 (deftest pathname.10
(equalt #p"sample-files/pathname.txt" (equalt #p"sample-files/pathname.txt"
(pathname (make-array 12 (pathname (make-array 25
:initial-contents "sample-files/pathname.txt" :initial-contents "sample-files/pathname.txt"
:element-type 'character :element-type 'character
:adjustable t))) :adjustable t)))
...@@ -77,11 +77,12 @@ ...@@ -77,11 +77,12 @@
collect collect
(equalt #p"sample-files/pathname.txt" (equalt #p"sample-files/pathname.txt"
(pathname (pathname
(let* ((s (make-array 15 (let* ((s (make-array 28
:initial-contents :initial-contents
"XXsample-files/pathname.txtX" "XXsample-files/pathname.txtX"
:element-type etype))) :element-type etype)))
(make-array 12 :element-type etype (make-array 25
:element-type etype
:displaced-to s :displaced-to s
:displaced-index-offset 2))))) :displaced-index-offset 2)))))
(t t t)) (t t t))
......
...@@ -6,35 +6,35 @@ ...@@ -6,35 +6,35 @@
(in-package :cl-test) (in-package :cl-test)
(deftest input-stream-p.1 (deftest input-stream-p.1
(notnot-mv (input-stream-p *standard-input*)) (notnot-mv (input-stream-p *standard-input*))
t) t)
(deftest input-stream-p.2 (deftest input-stream-p.2
(notnot-mv (input-stream-p *terminal-io*)) (notnot-mv (input-stream-p *terminal-io*))
t) t)
(deftest input-stream-p.3 (deftest input-stream-p.3
(with-open-file (s "input-stream-p.lsp" :direction :input) (with-open-file (s "sample-files/input-stream-p.txt" :direction :input)
(notnot-mv (input-stream-p s))) (notnot-mv (input-stream-p s)))
t) t)
(deftest input-stream-p.4 (deftest input-stream-p.4
(with-open-file (s "foo.txt" :direction :output (with-open-file (s "scratch/foo.txt" :direction :output
:if-exists :supersede) :if-exists :supersede)
(input-stream-p s)) (input-stream-p s))
nil) nil)
;;; Error tests ;;; Error tests
(deftest input-stream-p.error.1 (deftest input-stream-p.error.1
(signals-error (input-stream-p) program-error) (signals-error (input-stream-p) program-error)
t) t)
(deftest input-stream-p.error.2 (deftest input-stream-p.error.2
(signals-error (input-stream-p *standard-input* nil) (signals-error (input-stream-p *standard-input* nil)
program-error) program-error)
t) t)
(deftest input-stream-p.error.3 (deftest input-stream-p.error.3
(check-type-error #'input-stream-p #'streamp) (check-type-error #'input-stream-p #'streamp)
nil) nil)
...@@ -16,24 +16,24 @@ ...@@ -16,24 +16,24 @@
nil) nil)
(deftest open-stream-p.2 (deftest open-stream-p.2
(with-open-file (s "open-stream-p.lsp" :direction :input) (with-open-file (s "sample-files/open-stream-p.txt" :direction :input)
(notnot-mv (open-stream-p s))) (notnot-mv (open-stream-p s)))
t) t)
(deftest open-stream-p.3 (deftest open-stream-p.3
(with-open-file (s "foo.txt" :direction :output (with-open-file (s "scratch/foo.txt" :direction :output
:if-exists :supersede) :if-exists :supersede)
(notnot-mv (open-stream-p s))) (notnot-mv (open-stream-p s)))
t) t)
(deftest open-stream-p.4 (deftest open-stream-p.4
(let ((s (open "open-stream-p.lsp" :direction :input))) (let ((s (open "sample-files/open-stream-p.txt" :direction :input)))
(close s) (close s)
(open-stream-p s)) (open-stream-p s))
nil) nil)
(deftest open-stream-p.5 (deftest open-stream-p.5
(let ((s (open "foo.txt" :direction :output (let ((s (open "scratch/foo.txt" :direction :output
:if-exists :supersede))) :if-exists :supersede)))
(close s) (close s)
(open-stream-p s)) (open-stream-p s))
......
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
t) t)
(deftest output-stream-p.3 (deftest output-stream-p.3
(with-open-file (s "output-stream-p.lsp" :direction :input) (with-open-file (s "sample-files/output-stream-p.txt" :direction :input)
(output-stream-p s)) (output-stream-p s))
nil) nil)
(deftest output-stream-p.4 (deftest output-stream-p.4
(with-open-file (s "foo.txt" :direction :output (with-open-file (s "scratch/foo.txt" :direction :output
:if-exists :supersede) :if-exists :supersede)
(notnot-mv (output-stream-p s))) (notnot-mv (output-stream-p s)))
t) t)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment