diff options
Diffstat (limited to 'stdlib/source/test/lux/data')
-rw-r--r-- | stdlib/source/test/lux/data/binary.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/dictionary.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/dictionary/ordered.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/dictionary/plist.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/queue/priority.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/row.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/tree.lux | 24 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/tree/finger.lux | 8 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/tree/zipper.lux | 40 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/format/json.lux | 12 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/format/tar.lux | 14 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/lazy.lux | 20 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/maybe.lux | 10 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/text.lux | 48 |
14 files changed, 98 insertions, 98 deletions
diff --git a/stdlib/source/test/lux/data/binary.lux b/stdlib/source/test/lux/data/binary.lux index a9e977c0a..638668ec5 100644 --- a/stdlib/source/test/lux/data/binary.lux +++ b/stdlib/source/test/lux/data/binary.lux @@ -53,11 +53,11 @@ (def: (binary_io power read write value) (-> Nat (-> Nat Binary (Try Nat)) (-> Nat Nat Binary (Try Any)) Nat Bit) - (let [bytes (i64.left_shift power 1) + (let [bytes (i64.left_shifted power 1) binary (/.create bytes) cap (case bytes 8 (dec 0) - _ (|> 1 (i64.left_shift (n.* 8 bytes)) dec)) + _ (|> 1 (i64.left_shifted (n.* 8 bytes)) dec)) capped_value (i64.and cap value)] (and (..succeed (do try.monad diff --git a/stdlib/source/test/lux/data/collection/dictionary.lux b/stdlib/source/test/lux/data/collection/dictionary.lux index d51067799..2cec43439 100644 --- a/stdlib/source/test/lux/data/collection/dictionary.lux +++ b/stdlib/source/test/lux/data/collection/dictionary.lux @@ -81,7 +81,7 @@ (|> dict (/.get key) (maybe\map (n.= value)) - (maybe.default false))) + (maybe.else false))) entries)] (and correct_size! unique_keys! diff --git a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux index 0b98204a9..8302cdf38 100644 --- a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux +++ b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux @@ -132,5 +132,5 @@ (/.update extra_key (n.+ shift)) (/.get extra_key) (maybe\map (n.= (n.+ shift extra_value))) - (maybe.default false))) + (maybe.else false))) )))) diff --git a/stdlib/source/test/lux/data/collection/dictionary/plist.lux b/stdlib/source/test/lux/data/collection/dictionary/plist.lux index 7916da3eb..5ba785919 100644 --- a/stdlib/source/test/lux/data/collection/dictionary/plist.lux +++ b/stdlib/source/test/lux/data/collection/dictionary/plist.lux @@ -75,14 +75,14 @@ (/.put extra_key extra_value) (/.get extra_key) (maybe\map (n.= extra_value)) - (maybe.default false))) + (maybe.else false))) (_.cover [/.update] (|> sample (/.put extra_key extra_value) (/.update extra_key (n.+ shift)) (/.get extra_key) (maybe\map (n.= (n.+ shift extra_value))) - (maybe.default false))) + (maybe.else false))) (_.cover [/.remove] (|> sample (/.put extra_key extra_value) diff --git a/stdlib/source/test/lux/data/collection/queue/priority.lux b/stdlib/source/test/lux/data/collection/queue/priority.lux index 06238c4c8..07eff44ac 100644 --- a/stdlib/source/test/lux/data/collection/queue/priority.lux +++ b/stdlib/source/test/lux/data/collection/queue/priority.lux @@ -80,7 +80,7 @@ (/.push /.max max_member) /.peek (maybe\map (n.= max_member)) - (maybe.default false))) + (maybe.else false))) (_.cover [/.min] (|> /.empty (/.push /.max max_member) @@ -88,6 +88,6 @@ /.pop /.peek (maybe\map (n.= min_member)) - (maybe.default false))) + (maybe.else false))) )) )))) diff --git a/stdlib/source/test/lux/data/collection/row.lux b/stdlib/source/test/lux/data/collection/row.lux index 407fcde8e..3ac6e8965 100644 --- a/stdlib/source/test/lux/data/collection/row.lux +++ b/stdlib/source/test/lux/data/collection/row.lux @@ -99,13 +99,13 @@ (#try.Failure error) false)) (_.cover [/.put] - (<| (try.default false) + (<| (try.else false) (do try.monad [sample (/.put good_index non_member sample) actual (/.nth good_index sample)] (in (is? non_member actual))))) (_.cover [/.update] - (<| (try.default false) + (<| (try.else false) (do try.monad [sample (/.put good_index non_member sample) sample (/.update good_index inc sample) diff --git a/stdlib/source/test/lux/data/collection/tree.lux b/stdlib/source/test/lux/data/collection/tree.lux index a263b2451..ea58f8f72 100644 --- a/stdlib/source/test/lux/data/collection/tree.lux +++ b/stdlib/source/test/lux/data/collection/tree.lux @@ -47,15 +47,15 @@ (do random.monad [[size sample] (..tree random.nat)] - (_.cover [/.flatten] + (_.cover [/.flat] (n.= size - (list.size (/.flatten sample))))) + (list.size (/.flat sample))))) (do random.monad [expected random.nat] (_.cover [/.leaf] (\ (list.equivalence n.equivalence) = (list expected) - (/.flatten (/.leaf expected))))) + (/.flat (/.leaf expected))))) (do {! random.monad} [value random.nat num_children (\ ! map (n.% 3) random.nat) @@ -63,7 +63,7 @@ (_.cover [/.branch] (\ (list.equivalence n.equivalence) = (list& value children) - (/.flatten (/.branch value (list\map /.leaf children)))))) + (/.flat (/.branch value (list\map /.leaf children)))))) (do random.monad [expected/0 random.nat expected/1 random.nat @@ -74,18 +74,18 @@ (_.cover [/.tree] (and (\ (list.equivalence n.equivalence) = (list expected/0) - (/.flatten (/.tree expected/0))) + (/.flat (/.tree expected/0))) (\ (list.equivalence n.equivalence) = (list expected/0 expected/1 expected/2) - (/.flatten (/.tree expected/0 - {expected/1 {} - expected/2 {}}))) + (/.flat (/.tree expected/0 + {expected/1 {} + expected/2 {}}))) (\ (list.equivalence n.equivalence) = (list expected/0 expected/1 expected/2 expected/3 expected/4 expected/5) - (/.flatten (/.tree expected/0 - {expected/1 {} - expected/2 {expected/3 {} - expected/4 {expected/5 {}}}}))) + (/.flat (/.tree expected/0 + {expected/1 {} + expected/2 {expected/3 {} + expected/4 {expected/5 {}}}}))) ))) ))) diff --git a/stdlib/source/test/lux/data/collection/tree/finger.lux b/stdlib/source/test/lux/data/collection/tree/finger.lux index d14c4d27f..496c25865 100644 --- a/stdlib/source/test/lux/data/collection/tree/finger.lux +++ b/stdlib/source/test/lux/data/collection/tree/finger.lux @@ -96,13 +96,13 @@ (|> (\ ..builder leaf tag_left expected_left) (/.one (text.contains? tag_left)) (maybe\map (n.= expected_left)) - (maybe.default false)) + (maybe.else false)) cannot_find_incorrect_one! (|> (\ ..builder leaf tag_right expected_right) (/.one (text.contains? tag_left)) (maybe\map (n.= expected_left)) - (maybe.default false) + (maybe.else false) not) can_find_left! @@ -111,7 +111,7 @@ (\ ..builder leaf tag_right expected_right)) (/.one (text.contains? tag_left)) (maybe\map (n.= expected_left)) - (maybe.default false)) + (maybe.else false)) can_find_right! (|> (\ ..builder branch @@ -119,7 +119,7 @@ (\ ..builder leaf tag_right expected_right)) (/.one (text.contains? tag_right)) (maybe\map (n.= expected_right)) - (maybe.default false))] + (maybe.else false))] (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 df7333db5..749a8c59b 100644 --- a/stdlib/source/test/lux/data/collection/tree/zipper.lux +++ b/stdlib/source/test/lux/data/collection/tree/zipper.lux @@ -37,7 +37,7 @@ (do> maybe.monad [/.down] [/.value (n.= expected) in]) - (maybe.default false))) + (maybe.else false))) (_.cover [/.up] (|> (tree.branch expected (list (tree.leaf dummy))) /.zipper @@ -45,7 +45,7 @@ [/.down] [/.up] [/.value (n.= expected) in]) - (maybe.default false))) + (maybe.else false))) (_.cover [/.right] (|> (tree.branch dummy (list (tree.leaf dummy) (tree.leaf expected))) /.zipper @@ -53,7 +53,7 @@ [/.down] [/.right] [/.value (n.= expected) in]) - (maybe.default false))) + (maybe.else false))) (_.cover [/.rightmost] (|> (tree.branch dummy (list (tree.leaf dummy) @@ -65,7 +65,7 @@ [/.down] [/.rightmost] [/.value (n.= expected) in]) - (maybe.default false))) + (maybe.else false))) (_.cover [/.left] (|> (tree.branch dummy (list (tree.leaf expected) (tree.leaf dummy))) /.zipper @@ -74,7 +74,7 @@ [/.right] [/.left] [/.value (n.= expected) in]) - (maybe.default false))) + (maybe.else false))) (_.cover [/.leftmost] (|> (tree.branch dummy (list (tree.leaf expected) @@ -87,7 +87,7 @@ [/.rightmost] [/.leftmost] [/.value (n.= expected) in]) - (maybe.default false))) + (maybe.else false))) (_.cover [/.next] (and (|> (tree.branch dummy (list (tree.leaf expected) @@ -96,7 +96,7 @@ (do> maybe.monad [/.next] [/.value (n.= expected) in]) - (maybe.default false)) + (maybe.else false)) (|> (tree.branch dummy (list (tree.leaf dummy) (tree.leaf expected))) @@ -105,7 +105,7 @@ [/.next] [/.next] [/.value (n.= expected) in]) - (maybe.default false)))) + (maybe.else false)))) (_.cover [/.end] (|> (tree.branch dummy (list (tree.leaf dummy) @@ -116,7 +116,7 @@ (do> maybe.monad [/.end] [/.value (n.= expected) in]) - (maybe.default false))) + (maybe.else false))) (_.cover [/.start] (|> (tree.branch expected (list (tree.leaf dummy) @@ -128,7 +128,7 @@ [/.end] [/.start] [/.value (n.= expected) in]) - (maybe.default false))) + (maybe.else false))) (_.cover [/.previous] (and (|> (tree.branch expected (list (tree.leaf dummy) @@ -138,7 +138,7 @@ [/.next] [/.previous] [/.value (n.= expected) in]) - (maybe.default false)) + (maybe.else false)) (|> (tree.branch dummy (list (tree.leaf expected) (tree.leaf dummy))) @@ -148,7 +148,7 @@ [/.next] [/.previous] [/.value (n.= expected) in]) - (maybe.default false)))) + (maybe.else false)))) ))) (def: #export test @@ -198,7 +198,7 @@ /.zipper /.end (maybe\map /.end?) - (maybe.default false)))) + (maybe.else false)))) (_.cover [/.interpose] (let [cursor (|> (tree.branch dummy (list (tree.leaf dummy))) /.zipper @@ -208,13 +208,13 @@ (do> maybe.monad [/.down] [/.value (n.= expected) in]) - (maybe.default false)) + (maybe.else false)) (|> cursor (do> maybe.monad [/.down] [/.down] [/.value (n.= dummy) in]) - (maybe.default false))))) + (maybe.else false))))) (_.cover [/.adopt] (let [cursor (|> (tree.branch dummy (list (tree.leaf dummy))) /.zipper @@ -224,13 +224,13 @@ (do> maybe.monad [/.down] [/.value (n.= expected) in]) - (maybe.default false)) + (maybe.else false)) (|> cursor (do> maybe.monad [/.down] [/.right] [/.value (n.= dummy) in]) - (maybe.default false))))) + (maybe.else false))))) (_.cover [/.insert_left] (|> (tree.branch dummy (list (tree.leaf dummy))) /.zipper @@ -239,7 +239,7 @@ [(/.insert_left expected)] [/.left] [/.value (n.= expected) in]) - (maybe.default false))) + (maybe.else false))) (_.cover [/.insert_right] (|> (tree.branch dummy (list (tree.leaf dummy))) /.zipper @@ -248,7 +248,7 @@ [(/.insert_right expected)] [/.right] [/.value (n.= expected) in]) - (maybe.default false))) + (maybe.else false))) (_.cover [/.remove] (|> (tree.branch dummy (list (tree.leaf dummy))) /.zipper @@ -257,5 +257,5 @@ [(/.insert_left expected)] [/.remove] [/.value (n.= expected) in]) - (maybe.default false))) + (maybe.else false))) )))) diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux index e9acae043..063d3ef2f 100644 --- a/stdlib/source/test/lux/data/format/json.lux +++ b/stdlib/source/test/lux/data/format/json.lux @@ -86,7 +86,7 @@ /.format (\ /.codec decode) (try\map (\= expected)) - (try.default false)))) + (try.else false)))) (do random.monad [keys (random.set text.hash 3 (random.ascii/alpha 1)) values (random.set frac.hash 3 random.safe_frac) @@ -107,7 +107,7 @@ (list.every? (function (_ [key expected]) (|> (/.get key object) (try\map (\= expected)) - (try.default false))) + (try.else false))) expected)) )) (do random.monad @@ -116,14 +116,14 @@ (random.ascii/alpha 1)) expected random.safe_frac] (_.cover [/.set] - (<| (try.default false) + (<| (try.else false) (do try.monad [object (/.set key (#/.Number expected) (/.object (list))) #let [can_find_known_key! (|> object (/.get key) (try\map (\= (#/.Number expected))) - (try.default false)) + (try.else false)) cannot_find_unknown_key! (case (/.get unknown object) @@ -142,7 +142,7 @@ (|> (/.object (list [key (<tag> value)])) (<get> key) (try\map (\ <equivalence> = value)) - (try.default false))))] + (try.else false))))] [/.Boolean /.get_boolean #/.Boolean random.bit bit.equivalence] [/.Number /.get_number #/.Number random.safe_frac frac.equivalence] @@ -180,7 +180,7 @@ <key3> <string> <key4> [#null <boolean> <number> <string>] <key5> {<key6> <number>}})] - (<| (try.default false) + (<| (try.else false) (do try.monad [value0 (/.get <key0> object) value1 (/.get <key1> object) diff --git a/stdlib/source/test/lux/data/format/tar.lux b/stdlib/source/test/lux/data/format/tar.lux index 8dfe9635d..13c713f7f 100644 --- a/stdlib/source/test/lux/data/format/tar.lux +++ b/stdlib/source/test/lux/data/format/tar.lux @@ -181,7 +181,7 @@ _ false))) - (try.default false)))] + (try.else false)))] [/.Symbolic_Link #/.Symbolic_Link] [/.Directory #/.Directory] @@ -216,7 +216,7 @@ _ false))) - (try.default false)))] + (try.else false)))] [/.Normal #/.Normal] [/.Contiguous #/.Contiguous] @@ -268,7 +268,7 @@ _ false))) - (try.default false))) + (try.else false))) (~~ (template [<expected_mode>] [(_.cover [<expected_mode>] (|> (do try.monad @@ -291,7 +291,7 @@ _ false))) - (try.default false)))] + (try.else false)))] [/.none] @@ -360,7 +360,7 @@ _ false))) - (try.default false))) + (try.else false))) (_.cover [/.anonymous /.no_id] (|> (do try.monad [path (/.path path) @@ -388,7 +388,7 @@ _ false))) - (try.default false))) + (try.else false))) )))) (def: #export test @@ -403,7 +403,7 @@ (format.run /.writer) (<b>.run /.parser) (\ try.monad map row.empty?) - (try.default false))) + (try.else false))) (_.cover [/.invalid_end_of_archive] (let [dump (format.run /.writer row.empty)] (case (<b>.run /.parser (binary\compose dump dump)) diff --git a/stdlib/source/test/lux/data/lazy.lux b/stdlib/source/test/lux/data/lazy.lux index 0c93ae612..4fb2f6642 100644 --- a/stdlib/source/test/lux/data/lazy.lux +++ b/stdlib/source/test/lux/data/lazy.lux @@ -20,7 +20,7 @@ (def: injection (Injection Lazy) - (|>> /.freeze)) + (|>> /.lazy)) (def: comparison (Comparison Lazy) @@ -29,7 +29,7 @@ (def: #export lazy (All [a] (-> (Random a) (Random (Lazy a)))) - (\ random.functor map (|>> /.freeze))) + (\ random.functor map (|>> /.lazy))) (def: #export test Test @@ -52,16 +52,16 @@ (_.for [/.monad] ($monad.spec ..injection ..comparison /.monad)) - (_.cover [/.freeze] - (let [lazy (/.freeze <eager>) + (_.cover [/.lazy] + (let [lazy (/.lazy <eager>) (^open "\=") (product.equivalence n.equivalence n.equivalence)] (\= expected - (/.thaw lazy)))) + (/.value lazy)))) - (_.cover [/.thaw] - (let [lazy (/.freeze <eager>)] + (_.cover [/.value] + (let [lazy (/.lazy <eager>)] (and (not (is? expected - (/.thaw lazy))) - (is? (/.thaw lazy) - (/.thaw lazy))))) + (/.value lazy))) + (is? (/.value lazy) + (/.value lazy))))) )))))) diff --git a/stdlib/source/test/lux/data/maybe.lux b/stdlib/source/test/lux/data/maybe.lux index c2baca4fa..9aa890d9f 100644 --- a/stdlib/source/test/lux/data/maybe.lux +++ b/stdlib/source/test/lux/data/maybe.lux @@ -63,12 +63,12 @@ (do random.monad [default random.nat value random.nat] - (_.cover [/.default] - (and (is? default (/.default default - #.None)) + (_.cover [/.else] + (and (is? default (/.else default + #.None)) - (is? value (/.default default - (#.Some value)))))) + (is? value (/.else default + (#.Some value)))))) (do random.monad [value random.nat] (_.cover [/.assume] diff --git a/stdlib/source/test/lux/data/text.lux b/stdlib/source/test/lux/data/text.lux index f39c25c01..e1f9c1e4f 100644 --- a/stdlib/source/test/lux/data/text.lux +++ b/stdlib/source/test/lux/data/text.lux @@ -91,54 +91,54 @@ (/.contains? outer full)))) (_.cover [/.index_of] (and (|> (/.index_of inner (\ /.monoid compose inner outer)) - (maybe.default fake_index) + (maybe.else fake_index) (n.= 0)) (|> (/.index_of outer (\ /.monoid compose inner outer)) - (maybe.default fake_index) + (maybe.else fake_index) (n.= 1)))) (_.cover [/.index_of'] (let [full (\ /.monoid compose inner outer)] (and (|> (/.index_of' inner 0 full) - (maybe.default fake_index) + (maybe.else fake_index) (n.= 0)) (|> (/.index_of' inner 1 full) - (maybe.default fake_index) + (maybe.else fake_index) (n.= fake_index)) (|> (/.index_of' outer 0 full) - (maybe.default fake_index) + (maybe.else fake_index) (n.= 1)) (|> (/.index_of' outer 1 full) - (maybe.default fake_index) + (maybe.else fake_index) (n.= 1)) (|> (/.index_of' outer 2 full) - (maybe.default fake_index) + (maybe.else fake_index) (n.= fake_index))))) (_.cover [/.last_index_of] (let [full ($_ (\ /.monoid compose) outer inner outer)] (and (|> (/.last_index_of inner full) - (maybe.default fake_index) + (maybe.else fake_index) (n.= 1)) (|> (/.last_index_of outer full) - (maybe.default fake_index) + (maybe.else fake_index) (n.= 2))))) (_.cover [/.last_index_of'] (let [full ($_ (\ /.monoid compose) outer inner outer)] (and (|> (/.last_index_of' inner 0 full) - (maybe.default fake_index) + (maybe.else fake_index) (n.= 1)) (|> (/.last_index_of' inner 2 full) - (maybe.default fake_index) + (maybe.else fake_index) (n.= fake_index)) (|> (/.last_index_of' outer 0 full) - (maybe.default fake_index) + (maybe.else fake_index) (n.= 2)) (|> (/.last_index_of' outer 2 full) - (maybe.default fake_index) + (maybe.else fake_index) (n.= 2)) (|> (/.last_index_of' outer 3 full) - (maybe.default fake_index) + (maybe.else fake_index) (n.= fake_index))))) ))) @@ -234,42 +234,42 @@ #.None false)) - (_.cover [/.lower_case] + (_.cover [/.lower_cased] (let [effectiveness! (|> upper - /.lower_case + /.lower_cased (\ /.equivalence = upper) not) idempotence! (|> lower - /.lower_case + /.lower_cased (\ /.equivalence = lower)) inverse! (|> lower - /.upper_case - /.lower_case + /.upper_cased + /.lower_cased (\ /.equivalence = lower))] (and effectiveness! idempotence! inverse!))) - (_.cover [/.upper_case] + (_.cover [/.upper_cased] (let [effectiveness! (|> lower - /.upper_case + /.upper_cased (\ /.equivalence = lower) not) idempotence! (|> upper - /.upper_case + /.upper_cased (\ /.equivalence = upper)) inverse! (|> upper - /.lower_case - /.upper_case + /.lower_cased + /.upper_cased (\ /.equivalence = upper))] (and effectiveness! idempotence! |