Skip to content

Commit

Permalink
Change the code style for the tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurschreiber committed Apr 14, 2011
1 parent 940d1dd commit 3b7ecd9
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions lisp/version_space_test.lisp
Expand Up @@ -5,36 +5,23 @@

(define-test test-generalize
"should return an empty list if passed an empty hypothesis"
(assert-equal '()
(generalize '() '("a" "b"))
)
(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"))
)
(assert-equal '("a") (generalize '("a") '("a")) )
(assert-equal '("a") (generalize '("_") '("a")) )
(assert-equal '("a") (generalize '("a") '("_")) )
(assert-equal '("*") (generalize '("a") '("b")) )
)

(define-test test-more-general?
"should return true if the first list is equal to the second"
(assert-true (more-general? '("a") '("a")))
(assert-true (not (more-general? '("a") '("b"))))
(assert-true (more-general? '("a") '("a")) )
(assert-true (not (more-general? '("a") '("b"))) )

"should return true if the first list is more general than the second"
(assert-true (more-general? '("a" "*" "c") '("a" "b" "c")))
(assert-true (not (more-general? '("a" "*" "c") '("a" "b" "d"))))
(assert-true (more-general? '("a" "*" "c") '("a" "b" "c")) )
(assert-true (not (more-general? '("a" "*" "c") '("a" "b" "d"))) )
)

(run-tests)

0 comments on commit 3b7ecd9

Please sign in to comment.