diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/data/collection/tree.lux | 26 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/tree/finger.lux | 86 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/tree/zipper.lux | 12 |
3 files changed, 62 insertions, 62 deletions
diff --git a/stdlib/source/test/lux/data/collection/tree.lux b/stdlib/source/test/lux/data/collection/tree.lux index fef8c14f6..9cba03540 100644 --- a/stdlib/source/test/lux/data/collection/tree.lux +++ b/stdlib/source/test/lux/data/collection/tree.lux @@ -11,7 +11,7 @@ [data ["[0]" product] [collection - ["[0]" list ("[1]\[0]" functor mix)]]] + ["[0]" list ("[1]#[0]" functor mix)]]] [math ["[0]" random {"+" [Random]}] [number @@ -23,13 +23,13 @@ (All (_ a) (-> (Random a) (Random [Nat (Tree a)]))) (do [! random.monad] [value gen_value - num_children (\ ! each (n.% 2) random.nat) + num_children (# ! each (n.% 2) random.nat) children (random.list num_children (tree gen_value))] (in [(|> children - (list\each product.left) - (list\mix n.+ 1)) + (list#each product.left) + (list#mix n.+ 1)) [/.#value value - /.#children (list\each product.right children)]]))) + /.#children (list#each product.right children)]]))) (def: .public test Test @@ -38,7 +38,7 @@ ($_ _.and (_.for [/.equivalence] (|> (..tree random.nat) - (\ random.monad each product.right) + (# random.monad each product.right) ($equivalence.spec (/.equivalence n.equivalence)))) (_.for [/.mix] ($mix.spec /.leaf /.equivalence /.mix)) @@ -53,17 +53,17 @@ (do random.monad [expected random.nat] (_.cover [/.leaf] - (\ (list.equivalence n.equivalence) = + (# (list.equivalence n.equivalence) = (list expected) (/.flat (/.leaf expected))))) (do [! random.monad] [value random.nat - num_children (\ ! each (n.% 3) random.nat) + num_children (# ! each (n.% 3) random.nat) children (random.list num_children random.nat)] (_.cover [/.branch] - (\ (list.equivalence n.equivalence) = + (# (list.equivalence n.equivalence) = (list& value children) - (/.flat (/.branch value (list\each /.leaf children)))))) + (/.flat (/.branch value (list#each /.leaf children)))))) (do random.monad [expected/0 random.nat expected/1 random.nat @@ -72,15 +72,15 @@ expected/4 random.nat expected/5 random.nat] (_.cover [/.tree] - (and (\ (list.equivalence n.equivalence) = + (and (# (list.equivalence n.equivalence) = (list expected/0) (/.flat (/.tree expected/0))) - (\ (list.equivalence n.equivalence) = + (# (list.equivalence n.equivalence) = (list expected/0 expected/1 expected/2) (/.flat (/.tree expected/0 {expected/1 {} expected/2 {}}))) - (\ (list.equivalence n.equivalence) = + (# (list.equivalence n.equivalence) = (list expected/0 expected/1 expected/2 expected/3 expected/4 expected/5) (/.flat (/.tree expected/0 diff --git a/stdlib/source/test/lux/data/collection/tree/finger.lux b/stdlib/source/test/lux/data/collection/tree/finger.lux index e00a0773b..5285a8eca 100644 --- a/stdlib/source/test/lux/data/collection/tree/finger.lux +++ b/stdlib/source/test/lux/data/collection/tree/finger.lux @@ -5,11 +5,11 @@ [abstract [monad {"+" [do]}]] [control - ["[0]" maybe ("[1]\[0]" functor)]] + ["[0]" maybe ("[1]#[0]" functor)]] [data - ["[0]" text ("[1]\[0]" equivalence monoid)] + ["[0]" text ("[1]#[0]" equivalence monoid)] [collection - ["[0]" list ("[1]\[0]" mix)]]] + ["[0]" list ("[1]#[0]" mix)]]] [math ["[0]" random] [number @@ -34,7 +34,7 @@ (_.for [/.Tree]) (do [! random.monad] [tag_left (random.ascii/alpha_num 1) - tag_right (random.only (|>> (text\= tag_left) not) + tag_right (random.only (|>> (text#= tag_left) not) (random.ascii/alpha_num 1)) expected_left random.nat expected_right random.nat] @@ -43,22 +43,22 @@ (exec (/.builder text.monoid) true)) (_.cover [/.tag] - (and (text\= tag_left - (/.tag (\ ..builder leaf tag_left expected_left))) - (text\= (text\composite tag_left tag_right) - (/.tag (\ ..builder branch - (\ ..builder leaf tag_left expected_left) - (\ ..builder leaf tag_right expected_right)))))) + (and (text#= tag_left + (/.tag (# ..builder leaf tag_left expected_left))) + (text#= (text#composite tag_left tag_right) + (/.tag (# ..builder branch + (# ..builder leaf tag_left expected_left) + (# ..builder leaf tag_right expected_right)))))) (_.cover [/.root] - (and (case (/.root (\ ..builder leaf tag_left expected_left)) + (and (case (/.root (# ..builder leaf tag_left expected_left)) {.#Left actual} (n.= expected_left actual) {.#Right _} false) - (case (/.root (\ ..builder branch - (\ ..builder leaf tag_left expected_left) - (\ ..builder leaf tag_right expected_right))) + (case (/.root (# ..builder branch + (# ..builder leaf tag_left expected_left) + (# ..builder leaf tag_right expected_right))) {.#Left _} false @@ -73,11 +73,11 @@ false)))) (_.cover [/.value] (and (n.= expected_left - (/.value (\ ..builder leaf tag_left expected_left))) + (/.value (# ..builder leaf tag_left expected_left))) (n.= expected_left - (/.value (\ ..builder branch - (\ ..builder leaf tag_left expected_left) - (\ ..builder leaf tag_right expected_right)))))) + (/.value (# ..builder branch + (# ..builder leaf tag_left expected_left) + (# ..builder leaf tag_right expected_right)))))) (do random.monad [.let [tags_equivalence (list.equivalence text.equivalence) values_equivalence (list.equivalence n.equivalence)] @@ -86,40 +86,40 @@ values/H random.nat values/T (random.list 5 random.nat)] (_.cover [/.tags /.values] - (let [tree (list\mix (function (_ [tag value] tree) - (\ builder branch tree (\ builder leaf tag value))) - (\ builder leaf tags/H values/H) + (let [tree (list#mix (function (_ [tag value] tree) + (# builder branch tree (# builder leaf tag value))) + (# builder leaf tags/H values/H) (list.zipped/2 tags/T values/T))] - (and (\ tags_equivalence = (list& tags/H tags/T) (/.tags tree)) - (\ values_equivalence = (list& values/H values/T) (/.values tree)))))) + (and (# tags_equivalence = (list& tags/H tags/T) (/.tags tree)) + (# values_equivalence = (list& values/H values/T) (/.values tree)))))) (_.cover [/.one] (let [can_find_correct_one! - (|> (\ ..builder leaf tag_left expected_left) + (|> (# ..builder leaf tag_left expected_left) (/.one (text.contains? tag_left)) - (maybe\each (n.= expected_left)) + (maybe#each (n.= expected_left)) (maybe.else false)) cannot_find_incorrect_one! - (|> (\ ..builder leaf tag_right expected_right) + (|> (# ..builder leaf tag_right expected_right) (/.one (text.contains? tag_left)) - (maybe\each (n.= expected_left)) + (maybe#each (n.= expected_left)) (maybe.else false) not) can_find_left! - (|> (\ ..builder branch - (\ ..builder leaf tag_left expected_left) - (\ ..builder leaf tag_right expected_right)) + (|> (# ..builder branch + (# ..builder leaf tag_left expected_left) + (# ..builder leaf tag_right expected_right)) (/.one (text.contains? tag_left)) - (maybe\each (n.= expected_left)) + (maybe#each (n.= expected_left)) (maybe.else false)) can_find_right! - (|> (\ ..builder branch - (\ ..builder leaf tag_left expected_left) - (\ ..builder leaf tag_right expected_right)) + (|> (# ..builder branch + (# ..builder leaf tag_left expected_left) + (# ..builder leaf tag_right expected_right)) (/.one (text.contains? tag_right)) - (maybe\each (n.= expected_right)) + (maybe#each (n.= expected_right)) (maybe.else false))] (and can_find_correct_one! cannot_find_incorrect_one! @@ -128,23 +128,23 @@ (_.cover [/.exists?] (let [can_find_correct_one! (/.exists? (text.contains? tag_left) - (\ ..builder leaf tag_left expected_left)) + (# ..builder leaf tag_left expected_left)) cannot_find_incorrect_one! (not (/.exists? (text.contains? tag_left) - (\ ..builder leaf tag_right expected_right))) + (# ..builder leaf tag_right expected_right))) can_find_left! (/.exists? (text.contains? tag_left) - (\ ..builder branch - (\ ..builder leaf tag_left expected_left) - (\ ..builder leaf tag_right expected_right))) + (# ..builder branch + (# ..builder leaf tag_left expected_left) + (# ..builder leaf tag_right expected_right))) can_find_right! (/.exists? (text.contains? tag_right) - (\ ..builder branch - (\ ..builder leaf tag_left expected_left) - (\ ..builder leaf tag_right expected_right)))] + (# ..builder branch + (# ..builder leaf tag_left expected_left) + (# ..builder leaf tag_right expected_right)))] (and can_find_correct_one! cannot_find_incorrect_one! can_find_left! diff --git a/stdlib/source/test/lux/data/collection/tree/zipper.lux b/stdlib/source/test/lux/data/collection/tree/zipper.lux index f9308d080..bda2162f9 100644 --- a/stdlib/source/test/lux/data/collection/tree/zipper.lux +++ b/stdlib/source/test/lux/data/collection/tree/zipper.lux @@ -10,7 +10,7 @@ ["$[0]" comonad]]] [control pipe - ["[0]" maybe ("[1]\[0]" functor)]] + ["[0]" maybe ("[1]#[0]" functor)]] [data ["[0]" product] ["[0]" text] @@ -159,18 +159,18 @@ [[size sample] (//.tree random.nat) expected random.nat dummy (random.only (|>> (n.= expected) not) random.nat) - .let [(^open "tree\[0]") (tree.equivalence n.equivalence) - (^open "list\[0]") (list.equivalence n.equivalence)]] + .let [(^open "tree#[0]") (tree.equivalence n.equivalence) + (^open "list#[0]") (list.equivalence n.equivalence)]] ($_ _.and (_.for [/.equivalence] - ($equivalence.spec (/.equivalence n.equivalence) (\ ! each (|>> product.right /.zipper) (//.tree random.nat)))) + ($equivalence.spec (/.equivalence n.equivalence) (# ! each (|>> product.right /.zipper) (//.tree random.nat)))) (_.for [/.functor] ($functor.spec (|>> tree.leaf /.zipper) /.equivalence /.functor)) (_.for [/.comonad] ($comonad.spec (|>> tree.leaf /.zipper) /.equivalence /.comonad)) (_.cover [/.zipper /.tree] - (|> sample /.zipper /.tree (tree\= sample))) + (|> sample /.zipper /.tree (tree#= sample))) (_.cover [/.start?] (|> sample /.zipper /.start?)) (_.cover [/.leaf?] @@ -197,7 +197,7 @@ (|> sample /.zipper /.end - (maybe\each /.end?) + (maybe#each /.end?) (maybe.else false)))) (_.cover [/.interpose] (let [cursor (|> (tree.branch dummy (list (tree.leaf dummy))) |