Skip to content
Browse files

Add some tests for generalize.

  • Loading branch information...
1 parent 362bac4 commit 879d07906507f63f7885e3c6ef35580284f5a1b5 @arthurschreiber committed Apr 14, 2011
Showing with 32 additions and 0 deletions.
  1. +32 −0 lisp/version_space_test.lisp
View
32 lisp/version_space_test.lisp
@@ -0,0 +1,32 @@
+(load "vendor/lisp-unit.lisp")
+(load "version_space.lisp")
+
+(use-package :lisp-unit)
+
+(define-test test-generalize
+ "should return an empty list if passed an empty hypothesis"
+ (assert-equal '()
+ (generalize '() '("a" "b"))
+ )
+
+ "generalizes the two passed hypotheses"
+ (assert-equal '("a")
+ (generalize '("a") '("a"))
+ )
+
+ (assert-equal '("a")
+ (generalize '("_") '("a"))
+ )
+
+ (assert-equal '("a")
+ (generalize '("a") '("_"))
+ )
+
+ (assert-equal '("*")
+ (generalize '("a") '("b"))
+ )
+)
+
+
+
+(run-tests)

0 comments on commit 879d079

Please sign in to comment.
Something went wrong with that request. Please try again.