]> gitweb.factorcode.org Git - factor.git/blobdiff - core/sequences/sequences-tests.factor
core: Rename iota to <iota> so we can have TUPLE: iota ... ; instead of TUPLE: iota...
[factor.git] / core / sequences / sequences-tests.factor
index a91bf4e1007b940da8b2f984268a2d420e14bf11..72a326aaab5089394102d87c25865deb1b8bdc1d 100644 (file)
@@ -6,13 +6,13 @@ IN: sequences.tests
 { "empty" } [ { } [ "empty" ] [ "not empty" ] if-empty ] unit-test
 { { 1 } "not empty" } [ { 1 } [ "empty" ] [ "not empty" ] if-empty ] unit-test
 
-{ V{ 1 2 3 4 } } [ 1 5 dup iota <slice> >vector ] unit-test
-{ 3 } [ 1 4 dup iota <slice> length ] unit-test
+{ V{ 1 2 3 4 } } [ 1 5 dup <iota> <slice> >vector ] unit-test
+{ 3 } [ 1 4 dup <iota> <slice> length ] unit-test
 { 2 } [ 1 3 { 1 2 3 4 } <slice> length ] unit-test
 { V{ 2 3 } } [ 1 3 { 1 2 3 4 } <slice> >vector ] unit-test
 { V{ 4 5 } } [ { 1 2 3 4 5 } 2 tail-slice* >vector ] unit-test
-{ V{ 3 4 } } [ 2 4 1 10 dup iota <slice> subseq >vector ] unit-test
-{ V{ 3 4 } } [ 0 2 2 4 1 10 dup iota <slice> <slice> subseq >vector ] unit-test
+{ V{ 3 4 } } [ 2 4 1 10 dup <iota> <slice> subseq >vector ] unit-test
+{ V{ 3 4 } } [ 0 2 2 4 1 10 dup <iota> <slice> <slice> subseq >vector ] unit-test
 [ 0 10 "hello" <slice> ] must-fail
 [ -10 3 "hello" <slice> ] must-fail
 [ 2 1 "hello" <slice> ] must-fail
@@ -129,7 +129,7 @@ IN: sequences.tests
 { t } [ B{ 0 } { 1 } append byte-array? ] unit-test
 { t } [ B{ 0 } { 1 } prepend byte-array? ] unit-test
 
-{ "0123456789" } [ 58 iota [ 48 < ] "" reject-as ] unit-test
+{ "0123456789" } [ 58 <iota> [ 48 < ] "" reject-as ] unit-test
 
 { [ ]       } [ 1 [ ]           remove ] unit-test
 { [ ]       } [ 1 [ 1 ]         remove ] unit-test
@@ -166,7 +166,7 @@ IN: sequences.tests
 [ 4 [ CHAR: a <string> ] { } map-integers ]
 unit-test
 
-{ V{ 1 3 5 7 9 } } [ 10 iota >vector [ even? ] reject! ] unit-test
+{ V{ 1 3 5 7 9 } } [ 10 <iota> >vector [ even? ] reject! ] unit-test
 
 { V{ } } [ "f" V{ } clone remove! ] unit-test
 { V{ } } [ "f" V{ "f" } clone remove! ] unit-test
@@ -174,11 +174,11 @@ unit-test
 { V{ "x" } } [ "f" V{ "f" "x" "f" } clone remove! ] unit-test
 { V{ "y" "x" } } [ "f" V{ "y" "f" "x" "f" } clone remove! ] unit-test
 
-{ V{ 0 1 4 5 } } [ 6 iota >vector 2 4 pick delete-slice ] unit-test
+{ V{ 0 1 4 5 } } [ 6 <iota> >vector 2 4 pick delete-slice ] unit-test
 
 [ 6 >vector 2 8 pick delete-slice ] must-fail
 
-{ V{ } } [ 6 iota >vector 0 6 pick delete-slice ] unit-test
+{ V{ } } [ 6 <iota> >vector 0 6 pick delete-slice ] unit-test
 
 { { 1 2 "a" "b" 5 6 7 } } [
     { "a" "b" } 2 4 { 1 2 3 4 5 6 7 }
@@ -265,18 +265,18 @@ unit-test
 
 { 0 } [ f length ] unit-test
 [ f first ] must-fail
-{ 3 } [ 3 10 iota nth ] unit-test
-{ 3 } [ 3 10 iota nth-unsafe ] unit-test
-[ -3 10 iota nth ] must-fail
-[ 11 10 iota nth ] must-fail
+{ 3 } [ 3 10 <iota> nth ] unit-test
+{ 3 } [ 3 10 <iota> nth-unsafe ] unit-test
+[ -3 10 <iota> nth ] must-fail
+[ 11 10 <iota> nth ] must-fail
 
 { f } [ f ?first ] unit-test
 { f } [ { } ?first ] unit-test
-{ 0 } [ 10 iota ?first ] unit-test
+{ 0 } [ 10 <iota> ?first ] unit-test
 
 { f } [ f ?last ] unit-test
 { f } [ { } ?last ] unit-test
-{ 9 } [ 10 iota ?last ] unit-test
+{ 9 } [ 10 <iota> ?last ] unit-test
 
 [ -1/0. 0 remove-nth! ] must-fail
 { "" } [ "" [ CHAR: \s = ] trim ] unit-test
@@ -288,10 +288,10 @@ unit-test
 { "asdf " } [ " asdf " [ CHAR: \s = ] trim-head ] unit-test
 { " asdf" } [ " asdf " [ CHAR: \s = ] trim-tail ] unit-test
 
-{ 328350 } [ 100 iota [ sq ] map-sum ] unit-test
+{ 328350 } [ 100 <iota> [ sq ] map-sum ] unit-test
 
-{ 50 } [ 100 iota [ even? ] count ] unit-test
-{ 50 } [ 100 iota [ odd?  ] count ] unit-test
+{ 50 } [ 100 <iota> [ even? ] count ] unit-test
+{ 50 } [ 100 <iota> [ odd?  ] count ] unit-test
 
 { { "b" "d" } } [ { 1 3 } { "a" "b" "c" "d" } nths ] unit-test
 { { "a" "b" "c" "d" } } [ { 0 1 2 3 } { "a" "b" "c" "d" } nths ] unit-test
@@ -328,14 +328,14 @@ M: bogus-hashcode hashcode* 2drop 0 >bignum ;
 
 { V{ 0 3 } } [ "A" { "A" "B" "C" "A" "D" } indices ] unit-test
 
-[ "asdf" iota ] must-fail
-[ -1 iota ] must-fail
-{ T{ iota-tuple { n 10 } } } [ 10 iota ] unit-test
-{ 0 } [ 10 iota first ] unit-test
-{ 0 } [ 0 iota sum ] unit-test
-{ 0 } [ 1 iota sum ] unit-test
-{ 10 } [ 5 iota sum ] unit-test
-{ 15 } [ 6 iota sum ] unit-test
+[ "asdf" <iota> ] must-fail
+[ -1 <iota> ] must-fail
+{ T{ iota { n 10 } } } [ 10 <iota> ] unit-test
+{ 0 } [ 10 <iota> first ] unit-test
+{ 0 } [ 0 <iota> sum ] unit-test
+{ 0 } [ 1 <iota> sum ] unit-test
+{ 10 } [ 5 <iota> sum ] unit-test
+{ 15 } [ 6 <iota> sum ] unit-test
 
 { "hi" 3 } [
     { 1 2 3 4 5 6 7 8 } [ H{ { 3 "hi" } } at ] map-find
@@ -371,8 +371,8 @@ M: bogus-hashcode hashcode* 2drop 0 >bignum ;
 [ { } { } [ + ] [ + ] 2map-reduce ] must-fail
 { 24 } [ { 1 2 } { 3 4 } [ + ] [ * ] 2map-reduce ] unit-test
 
-{ 4 } [ 5 iota [ ] supremum-by ] unit-test
-{ 0 } [ 5 iota [ ] infimum-by ] unit-test
+{ 4 } [ 5 <iota> [ ] supremum-by ] unit-test
+{ 0 } [ 5 <iota> [ ] infimum-by ] unit-test
 { "bar" } [ { "bar" "baz" "qux" } [ length ] supremum-by ] unit-test
 { "bar" } [ { "bar" "baz" "qux" } [ length ] infimum-by ] unit-test
 { { "foo" } } [ { { "foo" } { "bar" } } [ first ] supremum-by ] unit-test