X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fload.impure.lisp;h=829950c079edad38eeaeb4663ea8e96b4d6fedb7;hb=1a3143cca7d6678c094b6bacc485e8531808ea59;hp=c9eab11115a061a457bb84e0a4b0fa1a140cf0da;hpb=8c81c0972f9e70f124b57394b5be29d9e661a0c7;p=sbcl.git diff --git a/tests/load.impure.lisp b/tests/load.impure.lisp index c9eab11..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* @@ -34,4 +36,35 @@ (when tmp-fasl (delete-file tmp-fasl)) (delete-file *tmp-filename*)))) -(quit :unix-status 104) +;;; 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*)))) +