Skip to content
Snippets Groups Projects
Commit 8c4f321f authored by pfdietz's avatar pfdietz
Browse files

Added note to indicate that open :if-exists :new-version should not throw an...

Added note to indicate that open :if-exists :new-version should not throw an error.  This note is disabled for sbcl.
parent 0089f60e
No related branches found
No related tags found
No related merge requests found
...@@ -26,3 +26,8 @@ ...@@ -26,3 +26,8 @@
(defnote :assume-no-simple-streams (defnote :assume-no-simple-streams
"Disable the test if simple streams are present.") "Disable the test if simple streams are present.")
(defnote :open-if-exists-new-version-no-error
"Assume that OPEN, when called with :if-exists :new-version, does not fail.")
#+sbcl (rt::disable-note :open-if-exists-new-version-no-error)
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
(defmacro def-open-test (name args form expected (defmacro def-open-test (name args form expected
&key &key
(notes nil notes-p)
(build-form nil build-form-p) (build-form nil build-form-p)
(element-type 'character element-type-p) (element-type 'character element-type-p)
(pathname #p"tmp.dat")) (pathname #p"tmp.dat"))
...@@ -74,6 +75,7 @@ ...@@ -74,6 +75,7 @@
)))) ))))
`(deftest ,name `(deftest ,name
,@(when notes-p `(:notes ,notes))
(let ((pn ,pathname)) (let ((pn ,pathname))
(delete-all-versions pn) (delete-all-versions pn)
,build-form ,build-form
...@@ -548,7 +550,9 @@ ...@@ -548,7 +550,9 @@
(with-open-file (with-open-file
(s pn :direction :input) (s pn :direction :input)
(values (read-line s nil)))) (values (read-line s nil))))
("wxyz")) ("wxyz")
:notes (:open-if-exists-new-version-no-error)
)
(def-open-test open.output.22 (:if-exists :rename :direction :output) (def-open-test open.output.22 (:if-exists :rename :direction :output)
(progn (write-sequence "wxyz" s) (progn (write-sequence "wxyz" s)
...@@ -628,6 +632,7 @@ ...@@ -628,6 +632,7 @@
;;; of the filespec is :newest ;;; of the filespec is :newest
(deftest open.output.30 (deftest open.output.30
:notes (:open-if-exists-new-version-no-error)
(let ((pn (make-pathname :name "tmp" :type "dat" :version :newest))) (let ((pn (make-pathname :name "tmp" :type "dat" :version :newest)))
(or (not (eql (pathname-version pn) :newest)) (or (not (eql (pathname-version pn) :newest))
(progn (progn
...@@ -877,7 +882,9 @@ ...@@ -877,7 +882,9 @@
(progn (write-sequence "wxyz" s) (progn (write-sequence "wxyz" s)
(file-position s :start) (file-position s :start)
(values (read-line s nil))) (values (read-line s nil)))
("wxyz")) ("wxyz")
:notes (:open-if-exists-new-version-no-error)
)
(def-open-test open.io.22 (:if-exists :rename :direction :io) (def-open-test open.io.22 (:if-exists :rename :direction :io)
(progn (write-sequence "wxyz" s) (progn (write-sequence "wxyz" s)
...@@ -945,6 +952,7 @@ ...@@ -945,6 +952,7 @@
;;; of the filespec is :newest ;;; of the filespec is :newest
(deftest open.io.30 (deftest open.io.30
:notes (:open-if-exists-new-version-no-error)
(let ((pn (make-pathname :name "tmp" :type "dat" :version :newest))) (let ((pn (make-pathname :name "tmp" :type "dat" :version :newest)))
(or (not (eql (pathname-version pn) :newest)) (or (not (eql (pathname-version pn) :newest))
(progn (progn
......
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