Commit 74c609e6 authored by pfdietz's avatar pfdietz

Add EQUALPT-OR-REPORT to remove some code duplication

parent 749be319
......@@ -87,6 +87,10 @@ Results: ~A~%" expected-number form n results))))
"Like EQUALP, but guaranteed to return T for true."
(apply #'values (mapcar #'notnot (multiple-value-list (equalp x y)))))
(defun equalpt-or-report (x y)
"Like EQUALPT, but return either T or a list of the arguments."
(or (equalpt x y) (list x y)))
(defun string=t (x y)
(notnot-mv (string= x y)))
......
......@@ -54,10 +54,10 @@
(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)))
(v7 (equalpt-or-report (namestring (truename target-pathname))
(namestring output-truename)))
(v8 (not (fboundp funname))))
(if (and v1 v2 v3 v4 v5 v6 v7 v8) t
(if (and v1 v2 v3 v4 v5 v6 (eql v7 t) v8) t
(list v1 v2 v3 v4 v5 v6 v7 v8)))
(progn
(load target-pathname)
......@@ -163,9 +163,9 @@
(compile-file file)
(load target-pathname)
(values
(equalpt (truename file) (funcall 'compile-file-test-fun.5))
(equalpt (pathname (merge-pathnames file))
(funcall 'compile-file-test-fun.5a))))
(equalpt-or-report (truename file) (funcall 'compile-file-test-fun.5))
(equalpt-or-report (pathname (merge-pathnames file))
(funcall 'compile-file-test-fun.5a))))
t t)
;;; Add tests of logical pathnames
......
......@@ -132,12 +132,10 @@
(notnot (load file))
(let ((p1 (pathname (merge-pathnames file)))
(p2 (funcall 'load-file-test-fun.1)))
(or (equalpt p1 p2)
(list p1 p2)))
(equalpt-or-report p1 p2))
(let ((p1 (truename file))
(p2 (funcall 'load-file-test-fun.2)))
(or (equalpt p1 p2)
(list p1 p2)))))
(equalpt-or-report p1 p2))))
t t t)
;;; Test that the load pathname/truename variables are bound
......@@ -154,12 +152,10 @@
(values
(let ((p1 (pathname (merge-pathnames target)))
(p2 *load-test-var.1*))
(or (equalpt p1 p2)
(list p1 p2)))
(equalpt-or-report p1 p2))
(let ((p1 (truename target))
(p2 *load-test-var.2*))
(or (equalpt p1 p2)
(list p1 p2)))))
(equalpt-or-report p1 p2))))
t t)
(deftest load.19
......
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