Skip to content

Commit

Permalink
Moar tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Fingerzam committed Oct 23, 2012
1 parent 94d9801 commit 16de4b0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/recursion_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
(facts "halve"
(halve [1 2 3 4]) => ['(1 2) '(3 4)]
(halve [1 2 3 4 5]) => ['(1 2) '(3 4 5)]
(halve [1]) => [empty? '(1)])
(halve [1]) => (just empty? '(1)))

(facts "seq-merge"
(seq-merge [4] [1 2 6 7]) => '(1 2 4 6 7)
Expand All @@ -157,19 +157,20 @@
(split-into-monotonics [0 5 4 7 1 3]) => '((0 5) (4 7) (1 3)))

(facts "permutations"
(permutations []) => [empty?]
(permutations []) => (just empty?)
(count (permutations (range 5))) => 120
(permutations [1 5 3])
=> (just [1 5 3] [5 1 3] [5 3 1] [1 3 5] [3 1 5] [3 5 1]
:in-any-order))

(facts "powerset"
(powerset []) => [empty?]
(powerset []) => (just empty?)
(powerset [1 2 4]) => (just empty?
(just 4 :in-any-order)
(just 2 :in-any-order)
(just 2 4 :in-any-order)
(just 1 :in-any-order)
(just 1 4 :in-any-order)
(just 1 2 :in-any-order)
(just 1 2 4 :in-any-order) :in-any-order))
(just 1 2 4 :in-any-order) :in-any-order)
(count (powerset (range 10))) => 1024)

0 comments on commit 16de4b0

Please sign in to comment.