]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/trees/trees-tests.factor
factor: use new math.ranges syntax in tests and docs
[factor.git] / extra / trees / trees-tests.factor
index fa1768aadcb8b90f9dfd6720a146e0a35bab5f62..4a989406ac70c93072f5ab7a05554c77571ba142 100644 (file)
@@ -113,22 +113,22 @@ CONSTANT: test-tree2 TREE{
 
 { f } [ 99 test-tree2 lower-node ]  unit-test
 { f } [ 100 test-tree2 lower-node ]  unit-test
-100 121 (a,b] [
+100 121 (a..b] [
     [ test-tree2-lower-key 1array ] keep [ test-tree2 lower-node key>> ] curry unit-test
 ] each
 
-99 120 [a,b) [
+99 120 [a..b) [
     [ test-tree2-higher-key 1array ] keep [ test-tree2 higher-node key>> ] curry unit-test
 ] each
 { f } [ 120 test-tree2 higher-node ]  unit-test
 { f } [ 121 test-tree2 higher-node ]  unit-test
 
 { f } [ 99 test-tree2 floor-node ]  unit-test
-100 121 [a,b] [
+100 121 [a..b] [
     [ test-tree2-floor-key 1array ] keep [ test-tree2 floor-node key>> ] curry unit-test
 ] each
 
-99 120 [a,b] [
+99 120 [a..b] [
     [ test-tree2-ceiling-key 1array ] keep [ test-tree2 ceiling-node key>> ] curry unit-test
 ] each
 { f } [ 121 test-tree2 ceiling-node ]  unit-test
@@ -164,10 +164,10 @@ CONSTANT: test-tree2 TREE{
 
 : ?a,b? ( a b ? ? -- range )
     2array {
-        { { t t } [ [a,b] ] }
-        { { t f } [ [a,b) ] }
-        { { f t } [ (a,b] ] }
-        { { f f } [ (a,b) ] }
+        { { t t } [ [a..b] ] }
+        { { t f } [ [a..b) ] }
+        { { f t } [ (a..b] ] }
+        { { f f } [ (a..b) ] }
     } case ;
 
 ! subtree>alist
@@ -182,7 +182,7 @@ CONSTANT: test-tree2 TREE{
         { { f f } [ subtree>alist() ] }
     } case ;
 
-99 121 [a,b] 2 all-combinations
+99 121 [a..b] 2 all-combinations
 { t f } dup 2array <product-sequence> 2array
 [ first2 [ first2 ] bi@
     {