Commit 9892866d authored by pfdietz's avatar pfdietz

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
......@@ -29,6 +29,7 @@
(deftest delete-file.3
(let ((pn "CLTEST:scratchfile.txt"))
(assert (typep (pathname pn) 'logical-pathname))
(unless (probe-file pn)
(with-open-file (s pn :direction :output)
(format s "Contents~%")))
......@@ -40,6 +41,7 @@
(deftest delete-file.4
(let ((pn "CLTEST:scratchfile.txt"))
(assert (typep (pathname pn) 'logical-pathname))
(unless (probe-file pn)
(with-open-file (s pn :direction :output)
(format s "Contents~%")))
......
......@@ -111,6 +111,8 @@
(pn2 "CLTEST:file-that-was-renamed.txt"))
(delete-all-versions pn1)
(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~%"))
(let ((results (multiple-value-list (rename-file pn1 pn2))))
(destructuring-bind (defaulted-new-name old-truename new-truename)
......
......@@ -45,8 +45,10 @@
"&")
(deftest with-output-to-string.8
(with-output-to-string (s nil :element-type 'base-char)
(write-char #\8 s))
(let ((str (with-output-to-string (s nil :element-type 'base-char)
(write-char #\8 s))))
(assert (typep str 'simple-base-string))
str)
"8")
(deftest with-output-to-string.9
......@@ -88,4 +90,20 @@
(write-char #\9 s))
"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
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