]> gitweb.factorcode.org Git - factor.git/commitdiff
sequences.extras: adding test for insert-sorted.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 14 May 2012 23:12:35 +0000 (16:12 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 14 May 2012 23:12:35 +0000 (16:12 -0700)
extra/sequences/extras/extras-tests.factor

index 564e2d2ea0c7446e55785af3080d121d7c315b63..49b3a7e26d468f9d66a9b6433ed0de65015095d3 100644 (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" } ]