Skip to content
Snippets Groups Projects
Commit 9892866d authored by pfdietz's avatar pfdietz
Browse files

Add some checks for logical pathnames to rename-file, delete-file tests. Add...

Add some checks for logical pathnames to rename-file, delete-file tests.  Add more tests for with-output-to-string for base-char element type.
parent c0631f20
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
(deftest delete-file.3 (deftest delete-file.3
(let ((pn "CLTEST:scratchfile.txt")) (let ((pn "CLTEST:scratchfile.txt"))
(assert (typep (pathname pn) 'logical-pathname))
(unless (probe-file pn) (unless (probe-file pn)
(with-open-file (s pn :direction :output) (with-open-file (s pn :direction :output)
(format s "Contents~%"))) (format s "Contents~%")))
...@@ -40,6 +41,7 @@ ...@@ -40,6 +41,7 @@
(deftest delete-file.4 (deftest delete-file.4
(let ((pn "CLTEST:scratchfile.txt")) (let ((pn "CLTEST:scratchfile.txt"))
(assert (typep (pathname pn) 'logical-pathname))
(unless (probe-file pn) (unless (probe-file pn)
(with-open-file (s pn :direction :output) (with-open-file (s pn :direction :output)
(format s "Contents~%"))) (format s "Contents~%")))
......
...@@ -111,6 +111,8 @@ ...@@ -111,6 +111,8 @@
(pn2 "CLTEST: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 pn2) 'logical-pathname))
(with-open-file (s pn1 :direction :output) (format s "Whatever~%")) (with-open-file (s pn1 :direction :output) (format s "Whatever~%"))
(let ((results (multiple-value-list (rename-file pn1 pn2)))) (let ((results (multiple-value-list (rename-file pn1 pn2))))
(destructuring-bind (defaulted-new-name old-truename new-truename) (destructuring-bind (defaulted-new-name old-truename new-truename)
......
...@@ -45,8 +45,10 @@ ...@@ -45,8 +45,10 @@
"&") "&")
(deftest with-output-to-string.8 (deftest with-output-to-string.8
(with-output-to-string (s nil :element-type 'base-char) (let ((str (with-output-to-string (s nil :element-type 'base-char)
(write-char #\8 s)) (write-char #\8 s))))
(assert (typep str 'simple-base-string))
str)
"8") "8")
(deftest with-output-to-string.9 (deftest with-output-to-string.9
...@@ -88,4 +90,20 @@ ...@@ -88,4 +90,20 @@
(write-char #\9 s)) (write-char #\9 s))
"049") "049")
(deftest with-output-to-string.14
(let* ((str1 (make-array '(256) :element-type 'base-char :fill-pointer 0))
(str2 (with-output-to-string
(s nil :element-type 'base-char)
(loop for i below 256
for c = (code-char i)
when (typep c 'base-char)
do (write-char c s)
do (vector-push c str1)))))
(if (string= str1 str2) :good
(list str1 str2)))
:good)
\ No newline at end of file
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