Commit bd5ec132 authored by pfdietz's avatar pfdietz
Browse files

More tests.

parent a2cb0c36
......@@ -78,9 +78,13 @@
(:method ((x t) (y t) (z t)) (list x y z))))))
(values
(typep* fn 'generic-function)
(typep* fn 'standard-generic-function)
(funcall fn 'a 'b 'c)
(apply fn 1 2 3 nil)
(apply fn (list 4 5 6))
(mapcar fn '(1 2) '(3 4) '(5 6))
(defgeneric.fun.1 'd 'e 'f)))
t (a b c) (d e f))
t t (a b c) (1 2 3) (4 5 6) ((1 3 5) (2 4 6)) (d e f))
(deftest defgeneric.2
(let ((fn (eval '(defgeneric defgeneric.fun.2 (x y z)
......@@ -88,6 +92,7 @@
(:method ((x t) (y t) (z t)) (vector x y z))))))
(values
(typep* fn 'generic-function)
(typep* fn 'standard-generic-function)
(funcall fn 'a 'b 'c)
(defgeneric.fun.2 'd 'e 'f)
(let ((doc (documentation fn t)))
......@@ -97,7 +102,7 @@
(or (not doc)
(and (stringp doc) (string=t doc "boo!"))))))
t #(a b c) #(d e f) t t)
t t #(a b c) #(d e f) t t)
(deftest defgeneric.3
(let ((fn (eval '(defgeneric defgeneric.fun.3 (x y)
......@@ -105,10 +110,11 @@
(:method ((x symbol) (y t)) (list y x))))))
(values
(typep* fn 'generic-function)
(typep* fn 'standard-generic-function)
(funcall fn 1 'a)
(funcall fn 'b 2)
(funcall fn 'a 'b)))
t
t t
(1 a)
(2 b)
(b a))
......@@ -120,10 +126,45 @@
(:method ((x symbol) (y t)) (list y x))))))
(values
(typep* fn 'generic-function)
(typep* fn 'standard-generic-function)
(funcall fn 1 'a)
(funcall fn 'b 2)
(funcall fn 'a 'b)))
t
t t
(1 a)
(2 b)
(a b))
(deftest defgeneric.5
(let ((fn (eval '(defgeneric defgeneric.fun.5 ()
(:method () (values))))))
(values
(typep* fn 'generic-function)
(typep* fn 'standard-generic-function)
(multiple-value-list (funcall fn))
(multiple-value-list (defgeneric.fun.5))
(multiple-value-list (apply fn nil))))
t t nil nil nil)
(deftest defgeneric.6
(let ((fn (eval '(defgeneric defgeneric.fun.6 ()
(:method () (values 'a 'b 'c))))))
(values
(typep* fn 'generic-function)
(typep* fn 'standard-generic-function)
(multiple-value-list (funcall fn))
(multiple-value-list (defgeneric.fun.6))
(multiple-value-list (apply fn nil))))
t t (a b c) (a b c) (a b c))
(deftest defgeneric.7
(let ((fn (eval '(defgeneric defgeneric.fun.7 ()
(:method () (return-from defgeneric.fun.7 'a) 'b)))))
(values
(typep* fn 'generic-function)
(typep* fn 'standard-generic-function)
(multiple-value-list (funcall fn))
(multiple-value-list (defgeneric.fun.7))
(multiple-value-list (apply fn nil))))
t t (a) (a) (a))
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