Added file.
Sun Jul 13 13:14:56 UTC 2008 mantoniotti
* Added file.
hunk ./test/unification-tests.lisp 6
-(in-package "UNIFY.TESTS")
-
hunk ./test/unification-tests.lisp 111
-(defstruct s-root a)
-(defstruct (s-child (:include s-root)) b)
-
hunk ./test/unification-tests.lisp 117
- (test '(#\Space T) (ignore-errors (v? '?x (unify "This is a string!" #T(elt 4 ?x))))
- :multiple-values t)
-
- (test '(42 T) (ignore-errors (v? '?x (unify '(0 1 42 3 4 5) #T(nth 2 ?x))))
- :multiple-values t)
-
- (test '(42 T) (ignore-errors (v? '?x (unify '(0 1 42 3 4 5) #T(elt 2 ?x))))
- :multiple-values t)
-
- (test '(42 T) (ignore-errors (v? '?x (unify #(0 1 42 3 4 5) #T(aref 2 ?x))))
- :multiple-values t)
-
- (test '(42 T) (ignore-errors (v? '?x (unify #(0 1 42 3 4 5) #T(elt 2 ?x))))
- :multiple-values t)
-
- (test '(42 T) (v? '?x (unify #2a((0 1 42 3 4 5)) #T(aref (0 2) ?x)))
- :multiple-values t)
-
- (test '(42 T) (v? '?x (unify #T(aref (0 2) 42) #2a((0 1 ?x 3 4 5))))
- :multiple-values t)
-
- (test '(42 T) (v? '?x (unify #2a((0 1 ?x 3 4 5)) #T(aref (0 2) 42)))
- :multiple-values t)
-
- (test-error (unify #(0 1 42 3 4 5) #T(nth 2 ?x))
- :condition-type 'unification-failure
- :announce t)
+ (test '(#\f T) (ignore-errors (v? '?x (unify "asdfasdfasdf" #T(elt 3 ?x))))
+ :multiple-values t
+ :known-failure t
+ :fail-info "ELT templates must be fixed.")
hunk ./test/unification-tests.lisp 122
- (test '(foo (1) (2) (3)) (let ((result-env (unify '(0 1 #T(list foo _ &rest ?z) 42)
- '(0 1 (?y bar (1) (2) (3)) 42)))
- )
- (cons (v? '?y result-env)
- (v? '?z result-env)))
- :test #'equal)
+ (test '(42 T) (ignore-errors (v? 'x (unify '(0 1 42 3 4 5) #T(nth 2 ?x))))
+ :multiple-values t
+ :known-failure t
+ :fail-info "NTH templates must be fixed.")
hunk ./test/unification-tests.lisp 128
- (make-instance 'test1 :a '(1 2 3) :b "woot")))
- :multiple-values t)
-
- (test-error (unify #T(s-root s-root-a '(1 ?x 3 4))
- (make-s-root :a '(1 2 3 4)))
- :condition-type 'unification-failure
- :announce t
- ;; #T reader non evaluating sub forms.
- )
-
- (test '(2 T) (v? '?x (unify #T(s-root s-root-a #T(list 1 ?x 3 4))
- (make-s-root :a '(1 2 3 4))))
- :multiple-values t)
-
- (test '(2 T) (v? '?x (unify #T(s-root s-root-a (1 ?x 3 4))
- (make-s-root :a '(1 2 3 4))))
- :multiple-values t)
-
- (test '(2 T) (v? '?x (unify #T(s-root s-root-a #T(list 1 ?x 3 &rest))
- (make-s-root :a '(1 2 3 4))))
- :multiple-values t)
-
- (test '(2 T) (v? '?x (unify #T(s-root s-root-a #(1 ?x 3 4))
- (make-s-root :a #(1 2 3 4))))
- :multiple-values t)
-
- (test '(2 T) (v? '?x (unify #T(s-root s-root-a #T(vector 1 ?x 3 &rest))
- (make-s-root :a #(1 2 3 4))))
+ (make-instance 'test1 :a '(1 2 3) :b "woot")))
hunk ./test/unification-tests.lisp 142
- (otherwise (error "error-outer"))))
+ (otherwise "error-outer")))
hunk ./test/unification-tests.lisp 145
- (test-error (nested-match-cases '(:a 42 :b 33)) :announce t)
-
- (test-error (nested-match-cases '(:a 42 :b (33 42))) :announce t)
+ (test "error-outer" (nested-match-cases '(:a 42 :b 33)) :test 'string=)
hunk ./test/unification-tests.lisp 147
- (test '(42 43 44) (nested-match-cases '(:a 42 :b ((:d 42) (:c 43) (:c 44))))
- :test #'equal)