Duplicate nested match-case tests for matchf-case.
Thu Feb 4 07:31:47 UTC 2010 pix@kepibu.org
* Duplicate nested match-case tests for matchf-case.
diff -rN -u old-cl-unification/test/unification-tests.lisp new-cl-unification/test/unification-tests.lisp
--- old-cl-unification/test/unification-tests.lisp 2015-12-24 03:58:15.000000000 +0000
+++ new-cl-unification/test/unification-tests.lisp 2015-12-24 03:58:15.000000000 +0000
@@ -209,15 +209,28 @@
(otherwise (error 'inner-error)))))
(otherwise (error 'outer-error))))
+(defun nested-matchf-cases (input)
+ (matchf-case (input)
+ ((:a ?a :b #T(list &rest ?bs))
+ (loop for b in ?bs
+ collect (matchf-case (b)
+ ((:c ?c) ?c)
+ ((:d ?d) ?d)
+ (otherwise (error 'inner-error)))))
+ (otherwise (error 'outer-error))))
+
(with-tests (:name "control flow")
(test-error (nested-match-cases '(:a 42 :b 33)) :condition-type 'outer-error)
-
(test-error (nested-match-cases '(:a 42 :b (33 42))) :condition-type 'inner-error)
-
(test '(42 43 44) (nested-match-cases '(:a 42 :b ((:d 42) (:c 43) (:c 44))))
:test #'equal)
- (test-error (match ('(x) '(x) :errorp nil)
+ (test-error (nested-matchf-cases '(:a 42 :b 33)) :condition-type 'outer-error)
+ (test-error (nested-matchf-cases '(:a 42 :b (33 42))) :condition-type 'inner-error)
+ (test '(42 43 44) (nested-matchf-cases '(:a 42 :b ((:d 42) (:c 43) (:c 44))))
+ :test #'equal)
+
+ (test-error (match ('(x) '(xx) :errorp nil)
(error 'inner-unification-failure))
:condition-type 'inner-unification-failure)