Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
-
decda1f5
by Raymond Toy at 2024-07-14T12:34:05+00:00
-
5c8483f8
by Raymond Toy at 2024-07-14T12:34:13+00:00
3 changed files:
Changes:
... | ... | @@ -565,7 +565,8 @@ |
565 | 565 | (fasload filename)
|
566 | 566 | (sloload filename))
|
567 | 567 | (let ((pn (merge-pathnames (pathname filename)
|
568 | - *default-pathname-defaults* nil)))
|
|
568 | + *default-pathname-defaults* nil))
|
|
569 | + (if-does-not-exist (if if-does-not-exist :error nil)))
|
|
569 | 570 | (if (wild-pathname-p pn)
|
570 | 571 | (dolist (file (directory pn) t)
|
571 | 572 | (internal-load pn file if-does-not-exist contents
|
... | ... | @@ -1119,7 +1119,7 @@ |
1119 | 1119 | |
1120 | 1120 | (defknown load
|
1121 | 1121 | ((or filename stream)
|
1122 | - &key (:verbose t) (:print t) (:if-does-not-exist (member :error nil))
|
|
1122 | + &key (:verbose t) (:print t) (:if-does-not-exist t)
|
|
1123 | 1123 | (:if-source-newer (member :load-source :load-object :query :compile))
|
1124 | 1124 | (:contents (or null (member :source :binary)))
|
1125 | 1125 | (:external-format t))
|
... | ... | @@ -1105,3 +1105,16 @@ |
1105 | 1105 | (not (zerop n))))
|
1106 | 1106 | (dolist (x '(0 1 1000))
|
1107 | 1107 | (assert-equal (expected x) (fun x) x))))
|
1108 | + |
|
1109 | +(define-test issue.333.if-does-not-exist
|
|
1110 | + (:tag :issues)
|
|
1111 | + ;; "unknown.lisp" should be a file that doesn't exist. Verify that
|
|
1112 | + ;; if :IF-DOES-NOT-EXIST is non-NIL we signal an error from LOAD.
|
|
1113 | + ;; The first case is the old default value of :ERROR.
|
|
1114 | + (assert-error 'file-error
|
|
1115 | + (load "unknown.lisp" :if-does-not-exist :error))
|
|
1116 | + ;; :IF-DOES-NOT-EXIST is a generalized BOOLEAN, so non-NIL will
|
|
1117 | + ;; signal an error too.
|
|
1118 | + (assert-error 'file-error
|
|
1119 | + (load "unknown.lisp" :if-does-not-exist t))
|
|
1120 | + (assert-false (load "unknown.lisp" :if-does-not-exist nil))) |