diff options
Diffstat (limited to 'stdlib/source/test')
-rw-r--r-- | stdlib/source/test/lux/data/collection.lux | 9 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/tree.lux (renamed from stdlib/source/test/lux/data/collection/tree/rose.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/tree/zipper.lux (renamed from stdlib/source/test/lux/data/collection/tree/rose/zipper.lux) | 17 |
3 files changed, 12 insertions, 14 deletions
diff --git a/stdlib/source/test/lux/data/collection.lux b/stdlib/source/test/lux/data/collection.lux index ad86d3225..0d6cb1e64 100644 --- a/stdlib/source/test/lux/data/collection.lux +++ b/stdlib/source/test/lux/data/collection.lux @@ -14,9 +14,8 @@ ["#/." priority]] ["#." set ["#/." ordered]] - ["#." tree #_ - ["#/." rose - ["#/." zipper]]]]) + ["#." tree + ["#/." zipper]]]) (def: dictionary Test @@ -42,8 +41,8 @@ (def: tree Test ($_ _.and - /tree/rose.test - /tree/rose/zipper.test + /tree.test + /tree/zipper.test )) (def: #export test diff --git a/stdlib/source/test/lux/data/collection/tree/rose.lux b/stdlib/source/test/lux/data/collection/tree.lux index 65b46e382..65b46e382 100644 --- a/stdlib/source/test/lux/data/collection/tree/rose.lux +++ b/stdlib/source/test/lux/data/collection/tree.lux diff --git a/stdlib/source/test/lux/data/collection/tree/rose/zipper.lux b/stdlib/source/test/lux/data/collection/tree/zipper.lux index e8f59a43a..f4b812420 100644 --- a/stdlib/source/test/lux/data/collection/tree/rose/zipper.lux +++ b/stdlib/source/test/lux/data/collection/tree/zipper.lux @@ -11,14 +11,13 @@ [number ["." nat]] [collection - ["." list] - [tree - ["." rose]]]] + ["." list]]] [math ["r" random]]] ["." //] {1 - ["." / (#+ Zipper)]} + ["." / (#+ Zipper) + ["tree" //]]} ) (def: #export test @@ -31,7 +30,7 @@ new-val r.nat pre-val r.nat post-val r.nat - #let [(^open "tree@.") (rose.equivalence nat.equivalence) + #let [(^open "tree@.") (tree.equivalence nat.equivalence) (^open "list@.") (list.equivalence nat.equivalence)]] ($_ _.and (_.test "Trees can be converted to/from zippers." @@ -51,7 +50,7 @@ (|> zipper (/.prepend-child new-val) /.branch?))))) (do @ [branch-value r.nat - #let [zipper (|> (/.zip (rose.branch branch-value (list (rose.leaf mid-val)))) + #let [zipper (|> (/.zip (tree.branch branch-value (list (tree.leaf mid-val)))) (/.prepend-child pre-val) (/.append-child post-val))]] (_.test "Can prepend and append children." @@ -63,7 +62,7 @@ (|> zipper /.down /.rightmost /.value (is? post-val)))))) (do @ [branch-value r.nat - #let [zipper (/.zip (rose.branch branch-value (list (rose.leaf mid-val))))]] + #let [zipper (/.zip (tree.branch branch-value (list (tree.leaf mid-val))))]] (_.test "Can insert children around a node (unless it's start)." (and (let [zipper (|> zipper /.down @@ -90,7 +89,7 @@ (|> sample /.zip (/.set new-val) /.value (n/= new-val))) (_.test "Zipper traversal follows the outline of the tree depth-first." (let [root (/.zip sample)] - (list@= (rose.flatten sample) + (list@= (tree.flatten sample) (loop [zipper (/.start root)] (let [zipper' (/.next zipper)] (#.Cons (/.value zipper) @@ -99,7 +98,7 @@ (recur zipper')))))))) (_.test "Backwards zipper traversal yield reverse tree flatten." (let [root (/.zip sample)] - (list@= (list.reverse (rose.flatten sample)) + (list@= (list.reverse (tree.flatten sample)) (loop [zipper (/.end root)] (#.Cons (/.value zipper) (if (:: (/.equivalence nat.equivalence) = root zipper) |