Commit 1e96891e authored by pfdietz's avatar pfdietz

Change asserts to a form that indicates the failing conditions in the return...

Change asserts to a form that indicates the failing conditions in the return value.  Add a test that *readtable* is bound in the compilation
parent c22a037a
(in-package "CL-TEST")
(defun compile-file-test-fun.4 () !foo)
......@@ -35,99 +35,100 @@
(*standard-output* str)
(apply #'compile-file file :allow-other-keys t args))))))
(assert (= (length vals) 3))
(assert (or print verbose (string= str "")) ()
"PRINT and VERBOSE are NIL and str is not empty: ~A"
str)
(assert (or (not verbose) (position #\; str)))
(destructuring-bind
(output-truename warnings-p failure-p)
vals
(assert (if actual-warnings-p failure-p t))
(assert (if expect-warnings failure-p t))
(assert (if expect-style-warnings warnings-p t))
(print (namestring (truename target-pathname)))
(print (namestring output-truename))
(values
(equalpt (namestring (truename target-pathname))
(namestring output-truename))
(notnot (fboundp funname))
(let ((v1 (or print verbose (string= str "")))
(v2 (or (not verbose) (position #\; str)))
(v3 (if actual-warnings-p failure-p t))
(v4 (if expect-warnings failure-p t))
(v5 (if expect-style-warnings warnings-p t))
(v6 (or (null output-truename) (pathnamep output-truename)))
(v7 (equalpt (namestring (truename target-pathname))
(namestring output-truename)))
(v8 (not (fboundp funname))))
(if (and v1 v2 v3 v4 v5 v6 v7 v8) t
(list v1 v2 v3 v4 v5 v6 v7 v8)))
(progn
(load target-pathname)
(funcall funname)))))))
(deftest compile-file.1
(compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1)
t nil nil)
t nil)
(deftest compile-file.2
(compile-file-test "compile-file-test-file-2.lsp" 'compile-file-test-fun.2
:expect-style-warnings t)
t nil nil)
t nil)
(deftest compile-file.2a
(compile-file-test "compile-file-test-file-2a.lsp" 'compile-file-test-fun.2a
:expect-warnings t)
t nil nil)
t nil)
(deftest compile-file.3
(let ((*package* (find-package "CL-TEST")))
(compile-file-test "compile-file-test-file-3.lsp" 'compile-file-test-fun.3))
t nil nil)
t nil)
(deftest compile-file.4
(let ((*package* (find-package "CL-USER")))
(compile-file-test "compile-file-test-file-3.lsp" 'cl-user::compile-file-test-fun.3))
t nil nil)
t nil)
(deftest compile-file.5
(compile-file-test #p"compile-file-test-file.lsp" 'compile-file-test-fun.1)
t nil nil)
t nil)
(deftest compile-file.6
(compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1
:output-file "foo.fasl")
t nil nil)
t nil)
(deftest compile-file.6a
(compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1
:output-file "foo.ufsl")
t nil nil)
t nil)
(deftest compile-file.7
(compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1
:external-format :default)
t nil nil)
t nil)
(deftest compile-file.8
(compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1
:output-file #p"foo.fasl")
t nil nil)
t nil)
(deftest compile-file.9
(compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1
:print t)
t nil nil)
t nil)
(deftest compile-file.10
(compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1
:verbose t)
t nil nil)
t nil)
(deftest compile-file.11
(compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1
:print nil)
t nil nil)
t nil)
(deftest compile-file.12
(compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1
:verbose nil)
t nil nil)
t nil)
;;; A file stream is a pathname designator
(deftest compile-file.13
(with-open-file (s "compile-file-test-file.lsp" :direction :input)
(compile-file-test s 'compile-file-test-fun.1))
t nil nil)
t nil)
(deftest compile-file.14
(let ((s (open "foo.fasl" :direction :output :if-exists :supersede
......@@ -135,7 +136,13 @@
(close s)
(compile-file-test "compile-file-test-file.lsp" 'compile-file-test-fun.1
:output-file s))
t nil nil)
t nil)
(deftest compile-file.15
(let ((*readtable* (copy-readtable nil)))
(set-macro-character #\! (get-macro-character #\'))
(compile-file-test "compile-file-test-file-4.lsp" 'compile-file-test-fun.4))
t foo)
;;; Add tests for *compile-file-truename*, *compile-file-pathname*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment