X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fload.impure.lisp;h=829950c079edad38eeaeb4663ea8e96b4d6fedb7;hb=22a6702974b7d6ff4e8f2b3b7b5ff446fc632de0;hp=b54b3745c995f8284d1700a8f9b61eed0ed7548e;hpb=e9840c3696d663a186df1a7e20d15b6caf4aec86;p=sbcl.git diff --git a/tests/load.impure.lisp b/tests/load.impure.lisp index b54b374..829950c 100644 --- a/tests/load.impure.lisp +++ b/tests/load.impure.lisp @@ -6,15 +6,17 @@ ;;;; While most of SBCL is derived from the CMU CL system, the test ;;;; files (like this one) were written from scratch after the fork ;;;; from CMU CL. -;;;; +;;;; ;;;; This software is in the public domain and is provided with ;;;; absolutely no warranty. See the COPYING and CREDITS files for ;;;; more information. +(defvar *tmp-filename* "load-test.tmp") + ;;; Bug reported by Sean Ross: FASL loader set fill pointer to loaded ;;; simple arrays. + (defvar *array*) -(defvar *tmp-filename* "load-test.tmp") (progn (with-open-file (s *tmp-filename* @@ -33,3 +35,36 @@ (assert (not (array-has-fill-pointer-p *array*))))) (when tmp-fasl (delete-file tmp-fasl)) (delete-file *tmp-filename*)))) + +;;; rudimentary external-format test +(dolist (ef '(:default :ascii :latin-1 :utf-8)) + (with-open-file (s *tmp-filename* + :direction :output + :if-exists :supersede + :if-does-not-exist :create) + (print '(defun foo (x) (1+ x)) s)) + (fmakunbound 'foo) + (let (tmp-fasl) + (unwind-protect + (progn + (setq tmp-fasl (compile-file *tmp-filename* :external-format ef)) + (load tmp-fasl) + (assert (= (foo 1) 2))) + (when tmp-fasl (delete-file tmp-fasl)) + (delete-file *tmp-filename*)))) + +;;; As reported by David Tolpin *LOAD-PATHNAME* was not merged. +(progn + (defvar *saved-load-pathname*) + (with-open-file (s *tmp-filename* + :direction :output + :if-exists :supersede + :if-does-not-exist :create) + (print '(setq *saved-load-pathname* *load-pathname*) s)) + (let (tmp-fasl) + (unwind-protect + (progn + (load *tmp-filename*) + (assert (equal (merge-pathnames *tmp-filename*) *saved-load-pathname*))) + (delete-file *tmp-filename*)))) +