X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fload.impure.lisp;h=fb7b9c91f11921e2d3ac5b20d2c10728dd5ba173;hb=1714224f33ba559eab11af8827a78f9a5aebd698;hp=b54b3745c995f8284d1700a8f9b61eed0ed7548e;hpb=e9840c3696d663a186df1a7e20d15b6caf4aec86;p=sbcl.git diff --git a/tests/load.impure.lisp b/tests/load.impure.lisp index b54b374..fb7b9c9 100644 --- a/tests/load.impure.lisp +++ b/tests/load.impure.lisp @@ -11,10 +11,12 @@ ;;;; 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,37 @@ (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*)))) + +(quit :unix-status 104)