1 ;;;; miscellaneous side-effectful tests of LOAD
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 (defvar *tmp-filename* "load-test.tmp")
16 ;;; Bug reported by Sean Ross: FASL loader set fill pointer to loaded
22 (with-open-file (s *tmp-filename*
25 :if-does-not-exist :create)
26 (print '(setq *array* #3a(((1 2) (2 1)) ((3 4) (4 3)))) s))
30 (setq tmp-fasl (compile-file *tmp-filename*))
33 (assert (arrayp *array*))
34 (assert (= (array-rank *array*) 3))
35 (assert (not (array-has-fill-pointer-p *array*)))))
36 (when tmp-fasl (delete-file tmp-fasl))
37 (delete-file *tmp-filename*))))
39 ;;; rudimentary external-format test
40 (dolist (ef '(:default :ascii :latin-1 :utf-8))
41 (with-open-file (s *tmp-filename*
44 :if-does-not-exist :create)
45 (print '(defun foo (x) (1+ x)) s))
50 (setq tmp-fasl (compile-file *tmp-filename* :external-format ef))
52 (assert (= (foo 1) 2)))
53 (when tmp-fasl (delete-file tmp-fasl))
54 (delete-file *tmp-filename*))))
56 ;;; As reported by David Tolpin *LOAD-PATHNAME* was not merged.
58 (defvar *saved-load-pathname*)
59 (with-open-file (s *tmp-filename*
62 :if-does-not-exist :create)
63 (print '(setq *saved-load-pathname* *load-pathname*) s))
68 (assert (equal (merge-pathnames *tmp-filename*) *saved-load-pathname*)))
69 (delete-file *tmp-filename*))))
71 (quit :unix-status 104)