Commit a48cda76 authored by pfdietz's avatar pfdietz
Browse files

Changed classify-error forms to signals-error forms.

parent a909e274
......@@ -370,19 +370,21 @@
(deftest defpackage.13
(progn
(safely-delete-package "H")
(classify-error
(eval '(defpackage "H" (:use) (:size 10) (:size 20)))))
program-error)
(signals-error
(defpackage "H" (:use) (:size 10) (:size 20))
program-error))
t)
;; Repeated documentation field should cause a program-error
(deftest defpackage.14
(progn
(safely-delete-package "H")
(classify-error
(eval '(defpackage "H" (:use)
(:documentation "foo")
(:documentation "bar")))))
program-error)
(signals-error
(defpackage "H" (:use)
(:documentation "foo")
(:documentation "bar"))
program-error))
t)
;; When a nickname refers to an existing package or nickname,
;; signal a package-error
......@@ -390,18 +392,18 @@
(deftest defpackage.15
(progn
(safely-delete-package "H")
(classify-error
(eval '(defpackage "H" (:use)
(:nicknames "A")))))
package-error)
(signals-error
(defpackage "H" (:use) (:nicknames "A"))
package-error))
t)
(deftest defpackage.16
(progn
(safely-delete-package "H")
(classify-error
(eval '(defpackage "H" (:use)
(:nicknames "Q")))))
package-error)
(signals-error
(defpackage "H" (:use) (:nicknames "Q"))
package-error))
t)
;; Names in :shadow, :shadowing-import-from, :import-from, and :intern
;; must be disjoint, or a package-error is signalled.
......@@ -412,11 +414,12 @@
(safely-delete-package "H")
(safely-delete-package "G")
(eval '(defpackage "G" (:use) (:export "A")))
(classify-error
(eval '(defpackage "H" (:use)
(:shadow "A")
(:shadowing-import-from "G" "A")))))
program-error)
(signals-error
(defpackage "H" (:use)
(:shadow "A")
(:shadowing-import-from "G" "A"))
program-error))
t)
;; :shadow and :import-from
(deftest defpackage.18
......@@ -424,21 +427,23 @@
(safely-delete-package "H")
(safely-delete-package "G")
(eval '(defpackage "G" (:use) (:export "A")))
(classify-error
(eval '(defpackage "H" (:use)
(:shadow "A")
(:import-from "G" "A")))))
program-error)
(signals-error
(defpackage "H" (:use)
(:shadow "A")
(:import-from "G" "A"))
program-error))
t)
;; :shadow and :intern
(deftest defpackage.19
(progn
(safely-delete-package "H")
(classify-error
(eval '(defpackage "H" (:use)
(:shadow "A")
(:intern "A")))))
program-error)
(signals-error
(defpackage "H" (:use)
(:shadow "A")
(:intern "A"))
program-error))
t)
;; :shadowing-import-from and :import-from
(deftest defpackage.20
......@@ -446,11 +451,12 @@
(safely-delete-package "H")
(safely-delete-package "G")
(eval '(defpackage "G" (:use) (:export "A")))
(classify-error
(eval '(defpackage "H" (:use)
(:shadowing-import-from "G" "A")
(:import-from "G" "A")))))
program-error)
(signals-error
(defpackage "H" (:use)
(:shadowing-import-from "G" "A")
(:import-from "G" "A"))
program-error))
t)
;; :shadowing-import-from and :intern
(deftest defpackage.21
......@@ -458,11 +464,12 @@
(safely-delete-package "H")
(safely-delete-package "G")
(eval '(defpackage "G" (:use) (:export "A")))
(classify-error
(eval '(defpackage "H" (:use)
(:shadowing-import-from "G" "A")
(:intern "A")))))
program-error)
(signals-error
(defpackage "H" (:use)
(:shadowing-import-from "G" "A")
(:intern "A"))
program-error))
t)
;; :import-from and :intern
(deftest defpackage.22
......@@ -470,22 +477,24 @@
(safely-delete-package "H")
(safely-delete-package "G")
(eval '(defpackage "G" (:use) (:export "A")))
(classify-error
(eval '(defpackage "H" (:use)
(:import-from "G" "A")
(:intern "A")))))
program-error)
(signals-error
(defpackage "H" (:use)
(:import-from "G" "A")
(:intern "A"))
program-error))
t)
;; Names given to :export and :intern must be disjoint,
;; otherwise signal a program-error
(deftest defpackage.23
(progn
(safely-delete-package "H")
(classify-error
(eval '(defpackage "H" (:use)
(:export "A")
(:intern "A")))))
program-error)
(signals-error
(defpackage "H" (:use)
(:export "A")
(:intern "A"))
program-error))
t)
;; :shadowing-import-from signals a correctable package-error
;; if the symbol is not accessible in the named package
......
......@@ -29,12 +29,12 @@
nil)
(deftest packagep.error.1
(classify-error (packagep))
program-error)
(signals-error (packagep) program-error)
t)
(deftest packagep.error.2
(classify-error (packagep nil nil))
program-error)
(signals-error (packagep nil nil) program-error)
t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; package-error
......@@ -95,12 +95,14 @@
t)
(deftest package-error-package.error.1
(classify-error (package-error-package))
program-error)
(signals-error (package-error-package) program-error)
t)
(deftest package-error-package.error.2
(classify-error
(signals-error
(package-error-package
(make-condition 'package-error :package #\A)
nil))
program-error)
nil)
program-error)
t)
......@@ -36,26 +36,25 @@
;;; Other error tests
(deftest package-shadowing-symbols.error.1
(classify-error (package-shadowing-symbols))
program-error)
(signals-error (package-shadowing-symbols) program-error)
t)
(deftest package-shadowing-symbols.error.2
(classify-error (package-shadowing-symbols "CL" nil))
program-error)
(signals-error (package-shadowing-symbols "CL" nil) program-error)
t)
(deftest package-use-list.error.1
(classify-error (package-use-list))
program-error)
(signals-error (package-use-list) program-error)
t)
(deftest package-use-list.error.2
(classify-error (package-use-list "CL" nil))
program-error)
(signals-error (package-use-list "CL" nil) program-error)
t)
(deftest package-used-by-list.error.1
(classify-error (package-used-by-list))
program-error)
(signals-error (package-used-by-list) program-error)
t)
(deftest package-used-by-list.error.2
(classify-error (package-used-by-list "CL" nil))
program-error)
(signals-error (package-used-by-list "CL" nil) program-error)
t)
......@@ -62,25 +62,26 @@
t)
(deftest pairlis.error.1
(classify-error (pairlis))
program-error)
(signals-error (pairlis) program-error)
t)
(deftest pairlis.error.2
(classify-error (pairlis nil))
program-error)
(signals-error (pairlis nil) program-error)
t)
(deftest pairlis.error.3
(classify-error (pairlis nil nil nil nil))
program-error)
(signals-error (pairlis nil nil nil nil) program-error)
t)
(deftest pairlis.error.4
(classify-error (pairlis 'a '(1)))
type-error)
(signals-error (pairlis 'a '(1)) type-error)
t)
(deftest pairlis.error.5
(classify-error (pairlis '(a) 'b))
type-error)
(signals-error (pairlis '(a) 'b) type-error)
t)
(deftest pairlis.error.6
(classify-error (pairlis '(a . b) '(c . d)))
type-error)
(signals-error (pairlis '(a . b) '(c . d)) type-error)
t)
......@@ -6,72 +6,72 @@
(in-package :cl-test)
(deftest parse-integer.error.1
(classify-error (parse-integer))
program-error)
(signals-error (parse-integer) program-error)
t)
(deftest parse-integer.error.2
(classify-error (parse-integer "123" :bogus))
program-error)
(signals-error (parse-integer "123" :bogus) program-error)
t)
(deftest parse-integer.error.3
(classify-error (parse-integer "123" :bogus 'foo))
program-error)
(signals-error (parse-integer "123" :bogus 'foo) program-error)
t)
(deftest parse-integer.error.4
(classify-error (parse-integer ""))
parse-error)
(signals-error (parse-integer "") parse-error)
t)
(deftest parse-integer.error.5
(loop for x across +standard-chars+
unless (or (digit-char-p x)
(eq (eval `(classify-error (parse-integer ,(string x))))
'parse-error))
(eval `(signals-error (parse-integer ,(string x))
parse-error)))
collect x)
nil)
(deftest parse-integer.error.5a
(classify-error (parse-integer ""))
parse-error)
(signals-error (parse-integer "") parse-error)
t)
(deftest parse-integer.error.6
(classify-error (parse-integer "1234a"))
parse-error)
(signals-error (parse-integer "1234a") parse-error)
t)
(deftest parse-integer.error.7
(classify-error (parse-integer "-"))
parse-error)
(signals-error (parse-integer "-") parse-error)
t)
(deftest parse-integer.error.8
(classify-error (parse-integer "+"))
parse-error)
(signals-error (parse-integer "+") parse-error)
t)
(deftest parse-integer.error.9
(classify-error (parse-integer "--10"))
parse-error)
(signals-error (parse-integer "--10") parse-error)
t)
(deftest parse-integer.error.10
(classify-error (parse-integer "++10"))
parse-error)
(signals-error (parse-integer "++10") parse-error)
t)
(deftest parse-integer.error.11
(classify-error (parse-integer "10."))
parse-error)
(signals-error (parse-integer "10.") parse-error)
t)
(deftest parse-integer.error.12
(classify-error (parse-integer "#O123"))
parse-error)
(signals-error (parse-integer "#O123") parse-error)
t)
(deftest parse-integer.error.13
(classify-error (parse-integer "#B0100"))
parse-error)
(signals-error (parse-integer "#B0100") parse-error)
t)
(deftest parse-integer.error.14
(classify-error (parse-integer "#X0100"))
parse-error)
(signals-error (parse-integer "#X0100") parse-error)
t)
(deftest parse-integer.error.15
(classify-error (parse-integer "#3R0100"))
parse-error)
(signals-error (parse-integer "#3R0100") parse-error)
t)
;;;
......
......@@ -60,8 +60,8 @@
t)
(deftest pathname-device.error.1
(classify-error (pathname-device))
program-error)
(signals-error (pathname-device) program-error)
t)
(deftest pathname-device.error.2
(loop for x in *mini-universe*
......
......@@ -75,8 +75,8 @@
nil)
(deftest pathname-directory.error.1
(classify-error (pathname-directory))
program-error)
(signals-error (pathname-directory) program-error)
t)
(deftest pathname-directory.error.2
(loop for x in *mini-universe*
......
......@@ -47,8 +47,8 @@
nil)
(deftest pathname-host.error.1
(classify-error (pathname-host))
program-error)
(signals-error (pathname-host) program-error)
t)
(deftest pathname-host.error.2
(loop for x in *mini-universe*
......@@ -60,5 +60,7 @@
nil)
(deftest pathname-host.error.3
(classify-error (pathname-host *default-pathname-defaults* '#:bogus t))
program-error)
(signals-error (pathname-host *default-pathname-defaults* '#:bogus t)
program-error)
t)
......@@ -61,8 +61,8 @@
nil)
(deftest pathname-name.error.1
(classify-error (pathname-name))
program-error)
(signals-error (pathname-name) program-error)
t)
(deftest pathname-name.error.2
(loop for x in *mini-universe*
......
......@@ -61,8 +61,8 @@
nil)
(deftest pathname-type.error.1
(classify-error (pathname-type))
program-error)
(signals-error (pathname-type) program-error)
t)
(deftest pathname-type.error.2
(loop for x in *mini-universe*
......
......@@ -20,12 +20,13 @@
nil)
(deftest pathname-version.error.1
(classify-error (pathname-version))
program-error)
(signals-error (pathname-version) program-error)
t)
(deftest pathname-version.error.2
(classify-error (pathname-version *default-pathname-defaults* nil))
program-error)
(signals-error (pathname-version *default-pathname-defaults* nil)
program-error)
t)
(deftest pathname-version.error.3
(loop for x in *mini-universe*
......
......@@ -34,9 +34,9 @@
;;; Error tests
(deftest pathname.error.1
(classify-error (pathname))
program-error)
(signals-error (pathname) program-error)
t)
(deftest pathname.error.2
(classify-error (pathname (first *pathnames*) nil))
program-error)
\ No newline at end of file
(signals-error (pathname (first *pathnames*) nil) program-error)
t)
......@@ -24,13 +24,14 @@
t)
(deftest pathnamep.error.1
(classify-error (pathnamep))
program-error)
(signals-error (pathnamep) program-error)
t)
(deftest pathnamep.error.2
(classify-error (pathnamep nil nil))
program-error)
(signals-error (pathnamep nil nil) program-error)
t)
(deftest pathnamep.error.3
(classify-error (pathnamep *default-pathname-defaults* nil))
program-error)
(signals-error (pathnamep *default-pathname-defaults* nil)
program-error)
t)
......@@ -6,17 +6,17 @@
(in-package :cl-test)
(deftest phase.error.1
(classify-error (phase))
program-error)
(signals-error (phase) program-error)
t)
(deftest phase.error.2
(classify-error (phase 0 0))
program-error)
(signals-error (phase 0 0) program-error)
t)
(deftest phase.error.3
(loop for x in *mini-universe*
unless (or (numberp x)
(eq (eval `(classify-error (phase ',x))) 'type-error))
(eval `(signals-error (phase ',x) type-error)))
collect x)
nil)
......
......@@ -5,25 +5,29 @@
(in-package :cl-test)
;;; Error tests
(deftest plusp.error.1
(classify-error (plusp))
program-error)
(signals-error (plusp) program-error)
t)
(deftest plusp.error.2
(classify-error (plusp 0 0))
program-error)
(signals-error (plusp 0 0) program-error)
t)
(deftest plusp.error.3
(classify-error (plusp 0 nil))
program-error)
(signals-error (plusp 0 nil) program-error)
t)
(deftest plusp.error.4
(loop for x in *mini-universe*
unless (realp x)
unless (eql (classify-error** `(plusp ',x)) 'type-error)
unless (eval `(signals-error (plusp ',x) type-error))
collect x)
nil)
;;; Non-error tests
(deftest plusp.1
(plusp 0)
nil)
......
......@@ -515,61 +515,61 @@
;;; Error tests
(deftest position-if-not.error.1
(classify-error (position-if-not #'identity 'b))
type-error)
(signals-error (position-if-not #'identity 'b) type-error)
t)
(deftest position-if-not.error.2
(classify-error (position-if-not #'identity 10))
type-error)
(signals-error (position-if-not #'identity 10) type-error)
t)
(deftest position-if-not.error.3
(classify-error (position-if-not 'null 1.4))
type-error)
(signals-error (position-if-not 'null 1.4) type-error)
t)
(deftest position-if-not.error.4
(classify-error (position-if-not 'identity '(a b c . d)))
type-error)
(signals-error (position-if-not 'identity '(a b c . d)) type-error)
t)
(deftest position-if-not.error.5
(classify-error (position-if-not))
program-error)
(signals-error (position-if-not) program-error)
t)
(deftest position-if-not.error.6
(classify-error (position-if-not #'null))
program-error)
(signals-error (position-if-not #'null) program-error)
t)
(deftest position-if-not.error.7
(classify-error (position-if-not #'null nil :key))
program-error)
(signals-error (position-if-not #'null nil :key) program-error)
t)
(deftest position-if-not.error.8
(classify-error (position-if-not #'null nil 'bad t))
program-error)
(signals-error (position-if-not #'null nil 'bad t) program-error)
t)
(deftest position-if-not.error.9
(classify-error (position-if-not #'null nil 'bad t :allow-other-keys nil))
program-error)
(signals-error (position-if-not #'null nil 'bad t :allow-other-keys nil) program-error)
t)
(deftest position-if-not.error.10
(classify-error (position-if-not #'null nil 1 2))
program-error)
(signals-error (position-if-not #'null nil 1 2) program-error)
t)