1 ;;;; miscellaneous tests of LOOP-related stuff
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; While most of SBCL is derived from the CMU CL system, the test
7 ;;;; files (like this one) were written from scratch after the fork
10 ;;;; This software is in the public domain and is provided with
11 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
12 ;;;; more information.
14 (in-package "CL-USER")
16 ;;; As reported by Gregory Wright sbcl-devel 2002-07-15, SBCL 0.7.5
17 ;;; didn't honor the LOAD :IF-DOES-NOT-EXIST argument when the type of
18 ;;; the LOADed file was specified.
19 (load "i-am-not" :if-does-not-exist nil
)
20 (load "i-am-not.lisp" :if-does-not-exist nil
)
21 (load "i-am-not.fasl" :if-does-not-exist nil
)
22 (load "i-am-not.misc-garbage" :if-does-not-exist nil
)
24 ;;; In 1.0.17, LOAD didn't error when the file didn't exist and
25 ;;; IF-DOES-NOT-EXIST was true.
26 (assert (typep (nth-value 1 (ignore-errors (load "i-am-not"))) 'file-error
))
27 (assert (typep (nth-value 1 (ignore-errors (load "i-am-not" :if-does-not-exist t
))) 'file-error
))
29 ;; These tests are essentially the same as in compiler.pure.lisp
30 (with-test (:name
:load-as-source-error-position-reporting
)
31 ;; These test errors that occur during READ
32 (dolist (input '("data/wonky1.lisp" "data/wonky2.lisp" "data/wonky3.lisp"))
33 (let ((expect (with-open-file (f input
) (read f
))))
34 (assert (stringp expect
))
37 ;; you can't query the stream position with HANDLER-CASE
38 ;; because it closes before the condition is formatted.
39 (handler-bind ((error (lambda (c)
41 (write-to-string c
:escape nil
)))))
43 (assert (search expect err-string
)))))
45 ;; This tests an error that occur during EVAL
46 (let ((s (with-output-to-string (*error-output
*)
47 (handler-bind ((error #'abort
)) (load "data/wonky4.lisp")))))
48 (assert (search "While evaluating the form starting at line 16, column 1"