Commit 2fd57a36 authored by pfdietz's avatar pfdietz

More changes to make the tests order-oblivious

parent b7f1f824
......@@ -10,12 +10,14 @@
(declaim (optimize (safety 3)))
(deftest do-symbols.1
(equalt
(remove-duplicates
(sort-symbols (let ((all nil))
(do-symbols (x "B" all) (push x all)))))
(list (find-symbol "BAR" "B")
(find-symbol "FOO" "A")))
(progn
(set-up-packages)
(equalt
(remove-duplicates
(sort-symbols (let ((all nil))
(do-symbols (x "B" all) (push x all)))))
(list (find-symbol "BAR" "B")
(find-symbol "FOO" "A"))))
t)
;;
......@@ -29,11 +31,11 @@
(do-symbols (x pkg all) (push x all))))))
(deftest do-symbols.2
(collect-symbols "DS1")
(collect-symbols "DS1")
(DS1:A DS1:B DS1::C DS1::D))
(deftest do-symbols.3
(collect-symbols "DS2")
(collect-symbols "DS2")
(DS2:A DS2::E DS2::F DS2:G DS2:H))
(deftest do-symbols.4
......@@ -91,6 +93,7 @@
`(deftest ,test-name
(let ((name ,name-form))
(assert (string= name "B"))
(set-up-packages)
(equalt
(remove-duplicates
(sort-symbols (let ((all nil))
......
......@@ -27,52 +27,66 @@
t)
(deftest find-package.4
(let ((p (ignore-errors (find-package "A"))))
(if (packagep p)
t
p))
(progn
(set-up-packages)
(let ((p (ignore-errors (find-package "A"))))
(if (packagep p)
t
p)))
t)
(deftest find-package.5
(let ((p (ignore-errors (find-package #\A))))
(if (packagep p)
t
p))
(progn
(set-up-packages)
(let ((p (ignore-errors (find-package #\A))))
(if (packagep p)
t
p)))
t)
(deftest find-package.6
(let ((p (ignore-errors (find-package "B"))))
(if (packagep p)
t
p))
(progn
(set-up-packages)
(let ((p (ignore-errors (find-package "B"))))
(if (packagep p)
t
p)))
t)
(deftest find-package.7
(let ((p (ignore-errors (find-package #\B))))
(if (packagep p)
t
p))
(progn
(set-up-packages)
(let ((p (ignore-errors (find-package #\B))))
(if (packagep p)
t
p)))
t)
(deftest find-package.8
(let ((p (ignore-errors (find-package "Q")))
(p2 (ignore-errors (find-package "A"))))
(and (packagep p)
(packagep p2)
(eqt p p2)))
(progn
(set-up-packages)
(let ((p (ignore-errors (find-package "Q")))
(p2 (ignore-errors (find-package "A"))))
(and (packagep p)
(packagep p2)
(eqt p p2))))
t)
(deftest find-package.9
(let ((p (ignore-errors (find-package "A")))
(p2 (ignore-errors (find-package "B"))))
(eqt p p2))
(progn
(set-up-packages)
(let ((p (ignore-errors (find-package "A")))
(p2 (ignore-errors (find-package "B"))))
(eqt p p2)))
nil)
(deftest find-package.10
(let ((p (ignore-errors (find-package #\Q)))
(p2 (ignore-errors (find-package "Q"))))
(and (packagep p)
(eqt p p2)))
(progn
(set-up-packages)
(let ((p (ignore-errors (find-package #\Q)))
(p2 (ignore-errors (find-package "Q"))))
(and (packagep p)
(eqt p p2))))
t)
(deftest find-package.11
......
......@@ -57,18 +57,35 @@
find-symbol.11 :internal)
(deftest find-symbol.12
(find-symbol "FOO" #\A)
A::FOO :external)
(progn
(set-up-packages)
(let ((vals (multiple-value-list (find-symbol "FOO" #\A))))
(values (length vals)
(package-name (symbol-package (first vals)))
(symbol-name (first vals))
(second vals))))
2 "A" "FOO" :external)
(deftest find-symbol.13
(progn
(set-up-packages)
(intern "X" (find-package "A"))
(find-symbol "X" #\A))
A::X :internal)
(let ((vals (multiple-value-list (find-symbol "X" #\A))))
(values (length vals)
(package-name (symbol-package (first vals)))
(symbol-name (first vals))
(second vals))))
2 "A" "X" :internal)
(deftest find-symbol.14
(find-symbol "FOO" #\B)
A::FOO :inherited)
(progn
(set-up-packages)
(let ((vals (multiple-value-list (find-symbol "FOO" #\B))))
(values (length vals)
(package-name (symbol-package (first vals)))
(symbol-name (first vals))
(second vals))))
2 "A" "FOO" :inherited)
(deftest find-symbol.15
(find-symbol "FOO" "FS-B")
......
......@@ -16,15 +16,18 @@
;; The required packages are present
(deftest list-all-packages.2
(subsetp
(list (find-package "CL")
(find-package "CL-USER")
(find-package "KEYWORD")
(find-package "A")
(find-package "REGRESSION-TEST")
(find-package "CL-TEST")
(find-package "B"))
(list-all-packages))
(progn
(set-up-packages)
(notnot
(subsetp
(list (find-package "CL")
(find-package "CL-USER")
(find-package "KEYWORD")
(find-package "A")
(find-package "REGRESSION-TEST")
(find-package "CL-TEST")
(find-package "B"))
(list-all-packages))))
t)
;; The list returned has only packages in it
......
......@@ -93,6 +93,7 @@
(deftest make-package.7
(progn
(set-up-packages)
(safely-delete-package "TEST1")
(let ((p (ignore-errors (make-package "TEST1" :use '("A")))))
(prog1
......@@ -106,6 +107,7 @@
(deftest make-package.7a
(progn
(set-up-packages)
(safely-delete-package "TEST1")
(let ((p (ignore-errors (make-package "TEST1" :use '(#:|A|)))))
(prog1
......@@ -119,6 +121,7 @@
(deftest make-package.7b
(progn
(set-up-packages)
(safely-delete-package "TEST1")
(let ((p (ignore-errors (make-package "TEST1" :use '(#\A)))))
(prog1
......@@ -132,6 +135,7 @@
(deftest make-package.8
(progn
(set-up-packages)
(safely-delete-package '#:|TEST1|)
(let ((p (ignore-errors (make-package '#:|TEST1| :use '("A")))))
(multiple-value-prog1
......@@ -145,6 +149,7 @@
(deftest make-package.8a
(progn
(set-up-packages)
(safely-delete-package '#:|TEST1|)
(let ((p (ignore-errors (make-package '#:|TEST1| :use '(#:|A|)))))
(multiple-value-prog1
......@@ -158,6 +163,7 @@
(deftest make-package.8b
(progn
(set-up-packages)
(safely-delete-package '#:|TEST1|)
(let ((p (ignore-errors (make-package '#:|TEST1| :use '(#\A)))))
(multiple-value-prog1
......@@ -171,6 +177,7 @@
(deftest make-package.9
(progn
(set-up-packages)
(safely-delete-package #\X)
(let ((p (ignore-errors (make-package #\X :use '("A")))))
(multiple-value-prog1
......@@ -184,6 +191,7 @@
(deftest make-package.9a
(progn
(set-up-packages)
(safely-delete-package #\X)
(let ((p (ignore-errors (make-package #\X :use '(#:|A|)))))
(multiple-value-prog1
......@@ -197,6 +205,7 @@
(deftest make-package.9b
(progn
(set-up-packages)
(safely-delete-package #\X)
(let ((p (ignore-errors (make-package #\X :use '(#\A)))))
(multiple-value-prog1
......@@ -380,6 +389,7 @@
(defmacro def-make-package-test3 (test-name name-form)
`(deftest ,test-name
(let ((name ,name-form))
(set-up-packages)
(safely-delete-package "TEST1")
(assert (find-package name))
(let ((p (ignore-errors (make-package "TEST1" :use (list name)))))
......@@ -435,22 +445,29 @@
;; exist as packages or nicknames of packages
(deftest make-package.error.1
(handle-non-abort-restart (make-package "A"))
(progn
(set-up-packages)
(handle-non-abort-restart (make-package "A")))
success)
(deftest make-package.error.2
(handle-non-abort-restart (make-package "Q"))
(progn
(set-up-packages)
(handle-non-abort-restart (make-package "Q")))
success)
(deftest make-package.error.3
(handle-non-abort-restart
(safely-delete-package "TEST1")
(make-package "TEST1" :nicknames '("A")))
(progn
(set-up-packages)
(handle-non-abort-restart
(safely-delete-package "TEST1")
(make-package "TEST1" :nicknames '("A"))))
success)
(deftest make-package.error.4
(handle-non-abort-restart
(safely-delete-package "TEST1")
(safely-delete-package "Q")
(make-package "TEST1" :nicknames '("Q")))
success)
......
......@@ -17,6 +17,18 @@
(:use "A")
(:export "BAR")))
(defun set-up-packages ()
(safely-delete-package "A")
(safely-delete-package "B")
(safely-delete-package "Q")
(defpackage "A"
(:use)
(:nicknames "Q")
(:export "FOO"))
(defpackage "B"
(:use "A")
(:export "BAR")))
(report-and-ignore-errors
(defpackage "FS-A"
(:use)
......
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