Skip to content
Snippets Groups Projects
Commit 115226ae authored by Daniel Kochmański's avatar Daniel Kochmański
Browse files

restructure: done?

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