sequences.extras: adding test for insert-sorted.

db4
John Benediktsson 2012-05-14 16:12:35 -07:00
parent 0f6972b98b
commit e90732f5e7
1 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,5 @@
USING: ascii kernel make math sequences sequences.extras strings
tools.test ;
USING: arrays ascii kernel make math random sequences
sequences.extras strings tools.test ;
IN: sequences.extras.tests
@ -19,6 +19,12 @@ IN: sequences.extras.tests
[ { "foo" } ] [ { { "foo" } { "bar" } } [ first ] maximum ] unit-test
[ { "bar" } ] [ { { "foo" } { "bar" } } [ first ] minimum ] unit-test
{ V{ 0 1 2 3 4 5 6 7 8 9 } } [
V{ } clone
10 iota >array randomize
[ swap insert-sorted ] each
] unit-test
[ { "a" "b" "c" "d" "ab" "bc" "cd" "abc" "bcd" "abcd" } ] [ "abcd" all-subseqs ] unit-test
[ { "a" "ab" "abc" "abcd" "b" "bc" "bcd" "c" "cd" "d" } ]