diff options
Diffstat (limited to '')
20 files changed, 217 insertions, 222 deletions
diff --git a/stdlib/source/test/lux/data/binary.lux b/stdlib/source/test/lux/data/binary.lux index d301efd1c..ca497af1c 100644 --- a/stdlib/source/test/lux/data/binary.lux +++ b/stdlib/source/test/lux/data/binary.lux @@ -25,10 +25,10 @@ (def: (succeed result) (-> (Try Bit) Bit) (case result - {#try.Failure _} + {try.#Failure _} false - {#try.Success output} + {try.#Success output} output)) (def: .public (random size) @@ -45,10 +45,10 @@ (def: (throws? exception try) (All (_ e a) (-> (Exception e) (Try a) Bit)) (case try - {#try.Failure error} + {try.#Failure error} (exception.match? exception error) - {#try.Success _} + {try.#Success _} false)) (def: (binary_io power read write value) @@ -72,7 +72,7 @@ (def: as_list (-> /.Binary (List Nat)) (/.aggregate (function (_ head tail) - {#.Item head tail}) + {.#Item head tail}) (list))) (def: .public test @@ -123,7 +123,7 @@ (and (n.= length (/.size random_slice)) (case [(monad.each try.monad (|>> (n.+ offset) (reader sample)) idxs) (monad.each try.monad (reader random_slice) idxs)] - [{#try.Success binary_vals} {#try.Success slice_vals}] + [{try.#Success binary_vals} {try.#Success slice_vals}] (\ (list.equivalence n.equivalence) = binary_vals slice_vals) _ @@ -138,19 +138,19 @@ (and (\ /.equivalence = sample (/.after 0 sample)) (\ /.equivalence = (/.empty 0) (/.after size sample)) (case (list.reversed (..as_list sample)) - #.End + {.#End} false - {#.Item head tail} + {.#Item head tail} (n.= (list.mix n.+ 0 tail) (/.aggregate n.+ 0 (/.after 1 sample)))))) (_.cover [/.copy] (and (case (/.copy size 0 sample 0 (/.empty size)) - {#try.Success output} + {try.#Success output} (and (not (same? sample output)) (\ /.equivalence = sample output)) - {#try.Failure _} + {try.#Failure _} false) (succeed (do try.monad diff --git a/stdlib/source/test/lux/data/collection/array.lux b/stdlib/source/test/lux/data/collection/array.lux index 243d77203..0337bd12a 100644 --- a/stdlib/source/test/lux/data/collection/array.lux +++ b/stdlib/source/test/lux/data/collection/array.lux @@ -59,33 +59,33 @@ (_.cover [/.example] (\ (maybe.equivalence n.equivalence) = (/.example n.even? the_array) - (list.example n.even? (/.list #.None the_array)))) + (list.example n.even? (/.list {.#None} the_array)))) (_.cover [/.example+] (case [(/.example n.even? the_array) (/.example+ (function (_ idx member) (n.even? member)) the_array)] - [{#.Some expected} {#.Some [idx actual]}] + [{.#Some expected} {.#Some [idx actual]}] (case (/.read! idx the_array) - {#.Some again} + {.#Some again} (and (n.= expected actual) (n.= actual again)) - #.None + {.#None} false) - [#.None #.None] + [{.#None} {.#None}] true _ false)) (_.cover [/.every?] (\ bit.equivalence = - (list.every? n.even? (/.list #.None the_array)) + (list.every? n.even? (/.list {.#None} the_array)) (/.every? n.even? the_array))) (_.cover [/.any?] (\ bit.equivalence = - (list.any? n.even? (/.list #.None the_array)) + (list.any? n.even? (/.list {.#None} the_array)) (/.any? n.even? the_array))) ))) @@ -109,7 +109,7 @@ (/.empty size))))) (_.cover [/.type_name] (case /.Array - (^ {#.Named _ {#.UnivQ _ {#.Primitive nominal_type (list {#.Parameter 1})}}}) + (^ {.#Named _ {.#UnivQ _ {.#Primitive nominal_type (list {.#Parameter 1})}}}) (same? /.type_name nominal_type) _ @@ -120,7 +120,7 @@ (/.write! 0 expected))] (case [(/.read! 0 the_array) (/.read! 1 the_array)] - [{#.Some actual} #.None] + [{.#Some actual} {.#None}] (n.= expected actual) _ @@ -131,7 +131,7 @@ (/.write! 0 expected))] (case [(/.read! 0 the_array) (/.read! 0 (/.delete! 0 the_array))] - [{#.Some actual} #.None] + [{.#Some actual} {.#None}] (n.= expected actual) _ @@ -149,7 +149,7 @@ (/.write! 0 base) (/.update! 0 (n.+ shift)))] (case (/.read! 0 the_array) - {#.Some actual} + {.#Some actual} (n.= expected actual) _ @@ -162,7 +162,7 @@ (/.upsert! 1 base (n.+ shift)))] (case [(/.read! 0 the_array) (/.read! 1 the_array)] - [{#.Some actual/0} {#.Some actual/1}] + [{.#Some actual/0} {.#Some actual/1}] (and (n.= expected actual/0) (n.= expected actual/1)) @@ -184,22 +184,22 @@ (do ! [the_list (random.list size random.nat) .let [the_array (/.clone the_array) - members (|> the_array (/.list #.None) (set.of_list n.hash))] + members (|> the_array (/.list {.#None}) (set.of_list n.hash))] default (random.only (function (_ value) (not (or (n.even? value) (set.member? members value)))) random.nat)] (_.cover [/.of_list /.list] - (and (|> the_list /.of_list (/.list #.None) + (and (|> the_list /.of_list (/.list {.#None}) (\ (list.equivalence n.equivalence) = the_list)) - (|> the_array (/.list #.None) /.of_list + (|> the_array (/.list {.#None}) /.of_list (\ (/.equivalence n.equivalence) = the_array)) (exec (/.filter! n.even? the_array) (list.every? (function (_ value) (or (n.even? value) (same? default value))) - (/.list {#.Some default} the_array)))))) + (/.list {.#Some default} the_array)))))) (do ! [amount (\ ! each (n.% (++ size)) random.nat)] (_.cover [/.copy!] @@ -207,18 +207,18 @@ (/.empty size))] (exec (/.copy! amount 0 the_array 0 copy) (\ (list.equivalence n.equivalence) = - (list.first amount (/.list #.None the_array)) - (/.list #.None copy)))))) + (list.first amount (/.list {.#None} the_array)) + (/.list {.#None} copy)))))) (_.cover [/.clone] (let [clone (/.clone the_array)] (and (not (same? the_array clone)) (\ (/.equivalence n.equivalence) = the_array clone)))) (let [the_array (/.clone the_array) - evens (|> the_array (/.list #.None) (list.only n.even?)) - odds (|> the_array (/.list #.None) (list.only n.odd?))] + evens (|> the_array (/.list {.#None}) (list.only n.even?)) + odds (|> the_array (/.list {.#None}) (list.only n.odd?))] (_.cover [/.filter!] (exec (/.filter! n.even? the_array) (and (n.= (list.size evens) (/.occupancy the_array)) (n.= (list.size odds) (/.vacancy the_array)) - (|> the_array (/.list #.None) (\ (list.equivalence n.equivalence) = evens)))))) + (|> the_array (/.list {.#None}) (\ (list.equivalence n.equivalence) = evens)))))) )))) diff --git a/stdlib/source/test/lux/data/collection/dictionary.lux b/stdlib/source/test/lux/data/collection/dictionary.lux index 2f8a58bfc..264f80fb9 100644 --- a/stdlib/source/test/lux/data/collection/dictionary.lux +++ b/stdlib/source/test/lux/data/collection/dictionary.lux @@ -147,39 +147,39 @@ (_.cover [/.value] (and (list.every? (function (_ key) (case (/.value key dict) - {#.Some _} true + {.#Some _} true _ false)) (/.keys dict)) (case (/.value non_key dict) - {#.Some _} false + {.#Some _} false _ true))) (_.cover [/.has] (and (n.= (++ (/.size dict)) (/.size (/.has non_key test_val dict))) (case (/.value non_key (/.has non_key test_val dict)) - {#.Some v} (n.= test_val v) + {.#Some v} (n.= test_val v) _ true))) (_.cover [/.has' /.key_already_exists] (let [can_put_new_keys! (case (/.has' non_key test_val dict) - {#try.Success dict} + {try.#Success dict} (case (/.value non_key dict) - {#.Some v} (n.= test_val v) + {.#Some v} (n.= test_val v) _ true) - {#try.Failure _} + {try.#Failure _} false) cannot_put_old_keys! (or (n.= 0 size) (let [first_key (|> dict /.keys list.head maybe.trusted)] (case (/.has' first_key test_val dict) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.key_already_exists error))))] (and can_put_new_keys! cannot_put_old_keys!))) @@ -189,10 +189,10 @@ (and (/.key? base non_key) (not (/.key? (/.lacks non_key base) non_key)))) (case (list.head (/.keys dict)) - #.None + {.#None} true - {#.Some known_key} + {.#Some known_key} (n.= (-- (/.size dict)) (/.size (/.lacks known_key dict)))))) @@ -200,7 +200,7 @@ (let [base (/.has non_key test_val dict) updt (/.revised non_key ++ base)] (case [(/.value non_key base) (/.value non_key updt)] - [{#.Some x} {#.Some y}] + [{.#Some x} {.#Some y}] (n.= (++ x) y) _ @@ -209,23 +209,23 @@ (_.cover [/.revised'] (let [can_upsert_new_key! (case (/.value non_key (/.revised' non_key test_val ++ dict)) - {#.Some inserted} + {.#Some inserted} (n.= (++ test_val) inserted) - #.None + {.#None} false) can_upsert_old_key! (case (list.head (/.entries dict)) - #.None + {.#None} true - {#.Some [known_key known_value]} + {.#Some [known_key known_value]} (case (/.value known_key (/.revised' known_key test_val ++ dict)) - {#.Some updated} + {.#Some updated} (n.= (++ known_value) updated) - #.None + {.#None} false))] (and can_upsert_new_key! can_upsert_old_key!))) diff --git a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux index 004b8e608..75749c61d 100644 --- a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux +++ b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux @@ -75,20 +75,20 @@ (/.empty? (/.empty n.order))) (_.cover [/.min] (case [(/.min sample) (list.head sorted_values)] - [#.None #.None] + [{.#None} {.#None}] #1 - [{#.Some reference} {#.Some sample}] + [{.#Some reference} {.#Some sample}] (n.= reference sample) _ #0)) (_.cover [/.max] (case [(/.max sample) (list.last sorted_values)] - [#.None #.None] + [{.#None} {.#None}] #1 - [{#.Some reference} {#.Some sample}] + [{.#Some reference} {.#Some sample}] (n.= reference sample) _ @@ -117,7 +117,7 @@ (let [sample+ (/.has extra_key extra_value sample)] (case [(/.value extra_key sample) (/.value extra_key sample+)] - [#.None {#.Some actual}] + [{.#None} {.#Some actual}] (n.= extra_value actual) _ diff --git a/stdlib/source/test/lux/data/collection/list.lux b/stdlib/source/test/lux/data/collection/list.lux index b2411ce74..d924cb788 100644 --- a/stdlib/source/test/lux/data/collection/list.lux +++ b/stdlib/source/test/lux/data/collection/list.lux @@ -168,10 +168,10 @@ (_.cover [/.item] (/.every? (function (_ [index expected]) (case (/.item index sample) - {#.Some actual} + {.#Some actual} (n.= expected actual) - #.None + {.#None} false)) (/.enumeration sample))) )))) @@ -238,20 +238,20 @@ [($_ _.and (_.cover [<head>] (case [(<pre> sample) (<head> sample)] - [{#.Item expected _} {#.Some actual}] + [{.#Item expected _} {.#Some actual}] (n.= expected actual) - [#.End #.None] + [{.#End} {.#None}] true _ false)) (_.cover [<tail>] (case [(<pre> sample) (<tail> sample)] - [{#.Item _ expected} {#.Some actual}] + [{.#Item _ expected} {.#Some actual}] (/\= (<pre> expected) actual) - [#.End #.None] + [{.#End} {.#None}] true _ @@ -355,8 +355,8 @@ choose (: (-> Nat (Maybe Text)) (function (_ value) (if (n.even? value) - {#.Some (\ n.decimal encoded value)} - #.None)))] + {.#Some (\ n.decimal encoded value)} + {.#None})))] (do [! random.monad] [sample ..random] ($_ _.and @@ -366,10 +366,10 @@ (/\each (\ n.decimal encoded)) /.head) (/.one choose sample)] - [{#.Some expected} {#.Some actual}] + [{.#Some expected} {.#Some actual}] (text\= expected actual) - [#.None #.None] + [{.#None} {.#None}] true _ @@ -382,10 +382,10 @@ (/.all choose sample))) (_.cover [/.example] (case (/.example n.even? sample) - {#.Some found} + {.#Some found} (n.even? found) - #.None + {.#None} (not (/.any? n.even? sample)))) )))) @@ -419,8 +419,8 @@ (/\= (/.indices size) (/.iterations (function (_ index) (if (n.< size index) - {#.Some (++ index)} - #.None)) + {.#Some (++ index)} + {.#None})) 0))))) (_.cover [/.mixes] (/\= (/\each (function (_ index) diff --git a/stdlib/source/test/lux/data/collection/queue.lux b/stdlib/source/test/lux/data/collection/queue.lux index 795806329..45053e52b 100644 --- a/stdlib/source/test/lux/data/collection/queue.lux +++ b/stdlib/source/test/lux/data/collection/queue.lux @@ -60,10 +60,10 @@ all_empty_queues_look_the_same!))) (_.cover [/.front] (case [members (/.front sample)] - [{#.Item head tail} {#.Some first}] + [{.#Item head tail} {.#Some first}] (n.= head first) - [#.End #.None] + [{.#End} {.#None}] true _ @@ -95,7 +95,7 @@ has_expected_order!))) (_.cover [/.next] (case members - {#.Item target expected} + {.#Item target expected} (let [popped (/.next sample) size_decreases! @@ -113,7 +113,7 @@ popped_member_is_not_identified! has_expected_order!)) - #.End + {.#End} (and (/.empty? sample) (/.empty? (/.next sample))))) )))) diff --git a/stdlib/source/test/lux/data/collection/queue/priority.lux b/stdlib/source/test/lux/data/collection/queue/priority.lux index 6ec5cb958..807ee4fd5 100644 --- a/stdlib/source/test/lux/data/collection/queue/priority.lux +++ b/stdlib/source/test/lux/data/collection/queue/priority.lux @@ -49,17 +49,17 @@ (/.empty? /.empty)) (_.cover [/.front] (case (/.front sample) - {#.Some first} + {.#Some first} (n.> 0 (/.size sample)) - #.None + {.#None} (/.empty? sample))) (_.cover [/.member?] (case (/.front sample) - {#.Some first} + {.#Some first} (/.member? n.equivalence sample first) - #.None + {.#None} (/.empty? sample))) (_.cover [/.end] (let [sample+ (/.end non_member_priority non_member sample)] diff --git a/stdlib/source/test/lux/data/collection/row.lux b/stdlib/source/test/lux/data/collection/row.lux index 684619006..17e1d8192 100644 --- a/stdlib/source/test/lux/data/collection/row.lux +++ b/stdlib/source/test/lux/data/collection/row.lux @@ -93,10 +93,10 @@ ($_ _.and (_.cover [/.item] (case (/.item good_index sample) - {#try.Success member} + {try.#Success member} (/.member? n.equivalence sample member) - {#try.Failure error} + {try.#Failure error} false)) (_.cover [/.has] (<| (try.else false) @@ -118,10 +118,10 @@ (let [fails! (: (All (_ a) (-> (Try a) Bit)) (function (_ situation) (case situation - {#try.Success member} + {try.#Success member} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.index_out_of_bounds error))))] (and (fails! (/.item bad_index sample)) (fails! (/.has bad_index non_member sample)) diff --git a/stdlib/source/test/lux/data/collection/set/ordered.lux b/stdlib/source/test/lux/data/collection/set/ordered.lux index 89ad780c7..383c5c747 100644 --- a/stdlib/source/test/lux/data/collection/set/ordered.lux +++ b/stdlib/source/test/lux/data/collection/set/ordered.lux @@ -74,10 +74,10 @@ (~~ (template [<coverage> <comparison>] [(_.cover [<coverage>] (case (<coverage> setL) - {#.Some value} + {.#Some value} (|> setL /.list (list.every? (<comparison> value))) - #.None + {.#None} (/.empty? setL)))] [/.min n.>=] diff --git a/stdlib/source/test/lux/data/collection/stack.lux b/stdlib/source/test/lux/data/collection/stack.lux index 928dc475a..97e69923f 100644 --- a/stdlib/source/test/lux/data/collection/stack.lux +++ b/stdlib/source/test/lux/data/collection/stack.lux @@ -45,26 +45,26 @@ (/.empty? /.empty)) (_.cover [/.value] (case (/.value sample) - #.None + {.#None} (/.empty? sample) - {#.Some _} + {.#Some _} (not (/.empty? sample)))) (_.cover [/.next] (case (/.next sample) - #.None + {.#None} (/.empty? sample) - {#.Some [top remaining]} + {.#Some [top remaining]} (\ (/.equivalence n.equivalence) = sample (/.top top remaining)))) (_.cover [/.top] (case (/.next (/.top expected_top sample)) - {#.Some [actual_top actual_sample]} + {.#Some [actual_top actual_sample]} (and (same? expected_top actual_top) (same? sample actual_sample)) - #.None + {.#None} false)) )))) diff --git a/stdlib/source/test/lux/data/collection/tree.lux b/stdlib/source/test/lux/data/collection/tree.lux index 0e18e595e..fef8c14f6 100644 --- a/stdlib/source/test/lux/data/collection/tree.lux +++ b/stdlib/source/test/lux/data/collection/tree.lux @@ -28,8 +28,8 @@ (in [(|> children (list\each product.left) (list\mix n.+ 1)) - [#/.value value - #/.children (list\each product.right children)]]))) + [/.#value value + /.#children (list\each product.right children)]]))) (def: .public test Test diff --git a/stdlib/source/test/lux/data/collection/tree/finger.lux b/stdlib/source/test/lux/data/collection/tree/finger.lux index c067ba36c..e00a0773b 100644 --- a/stdlib/source/test/lux/data/collection/tree/finger.lux +++ b/stdlib/source/test/lux/data/collection/tree/finger.lux @@ -51,21 +51,21 @@ (\ ..builder leaf tag_right expected_right)))))) (_.cover [/.root] (and (case (/.root (\ ..builder leaf tag_left expected_left)) - {#.Left actual} + {.#Left actual} (n.= expected_left actual) - {#.Right _} + {.#Right _} false) (case (/.root (\ ..builder branch (\ ..builder leaf tag_left expected_left) (\ ..builder leaf tag_right expected_right))) - {#.Left _} + {.#Left _} false - {#.Right [left right]} + {.#Right [left right]} (case [(/.root left) (/.root right)] - [{#.Left actual_left} {#.Left actual_right}] + [{.#Left actual_left} {.#Left actual_right}] (and (n.= expected_left actual_left) (n.= expected_right actual_right)) diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux index 0b6a33e05..f71def6fe 100644 --- a/stdlib/source/test/lux/data/format/json.lux +++ b/stdlib/source/test/lux/data/format/json.lux @@ -77,7 +77,7 @@ (\ bit.equivalence = (/.null? sample) (case sample - #/.Null true + {/.#Null} true _ false)))) (do random.monad [expected ..random] @@ -91,17 +91,17 @@ [keys (random.set text.hash 3 (random.ascii/alpha 1)) values (random.set frac.hash 3 random.safe_frac) .let [expected (list.zipped/2 (set.list keys) - (list\each (|>> #/.Number) (set.list values))) + (list\each (|>> {/.#Number}) (set.list values))) object (/.object expected)]] ($_ _.and (_.cover [/.object /.fields] (case (/.fields object) - {#try.Success actual} + {try.#Success actual} (\ (list.equivalence text.equivalence) = (list\each product.left expected) actual) - {#try.Failure error} + {try.#Failure error} false)) (_.cover [/.field] (list.every? (function (_ [key expected]) @@ -118,19 +118,19 @@ (_.cover [/.has] (<| (try.else false) (do try.monad - [object (/.has key {#/.Number expected} (/.object (list))) + [object (/.has key {/.#Number expected} (/.object (list))) .let [can_find_known_key! (|> object (/.field key) - (try\each (\= {#/.Number expected})) + (try\each (\= {/.#Number expected})) (try.else false)) cannot_find_unknown_key! (case (/.field unknown object) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} true)]] (in (and can_find_known_key! cannot_find_unknown_key!)))))) @@ -144,19 +144,19 @@ (try\each (\ <equivalence> = value)) (try.else false))))] - [/.Boolean /.boolean_field #/.Boolean random.bit bit.equivalence] - [/.Number /.number_field #/.Number random.safe_frac frac.equivalence] - [/.String /.string_field #/.String (random.ascii/alpha 1) text.equivalence] - [/.Array /.array_field #/.Array (random.row 3 ..random) (row.equivalence /.equivalence)] - [/.Object /.object_field #/.Object (random.dictionary text.hash 3 (random.ascii/alpha 1) ..random) (dictionary.equivalence /.equivalence)] + [/.Boolean /.boolean_field /.#Boolean random.bit bit.equivalence] + [/.Number /.number_field /.#Number random.safe_frac frac.equivalence] + [/.String /.string_field /.#String (random.ascii/alpha 1) text.equivalence] + [/.Array /.array_field /.#Array (random.row 3 ..random) (row.equivalence /.equivalence)] + [/.Object /.object_field /.#Object (random.dictionary text.hash 3 (random.ascii/alpha 1) ..random) (dictionary.equivalence /.equivalence)] )) (with_expansions [<boolean> (boolean) <number> (number) <string> (string) - <array_row> (row.row #/.Null - {#/.Boolean <boolean>} - {#/.Number <number>} - {#/.String <string>}) + <array_row> (row.row {/.#Null} + {/.#Boolean <boolean>} + {/.#Number <number>} + {/.#String <string>}) <key0> (string) <key1> (string) <key2> (string) @@ -165,20 +165,20 @@ <key5> (string) <key6> (string)] (_.cover [/.json] - (and (\= #/.Null (/.json #null)) + (and (\= {/.#Null} (/.json ())) (~~ (template [<tag> <value>] [(\= {<tag> <value>} (/.json <value>))] - [#/.Boolean <boolean>] - [#/.Number <number>] - [#/.String <string>] + [/.#Boolean <boolean>] + [/.#Number <number>] + [/.#String <string>] )) - (\= {#/.Array <array_row>} (/.json [#null <boolean> <number> <string>])) - (let [object (/.json {<key0> #null + (\= {/.#Array <array_row>} (/.json [() <boolean> <number> <string>])) + (let [object (/.json {<key0> () <key1> <boolean> <key2> <number> <key3> <string> - <key4> [#null <boolean> <number> <string>] + <key4> [() <boolean> <number> <string>] <key5> {<key6> <number>}})] (<| (try.else false) (do try.monad @@ -189,11 +189,11 @@ value4 (/.field <key4> object) value5 (/.field <key5> object) value6 (/.field <key6> value5)] - (in (and (\= #/.Null value0) - (\= {#/.Boolean <boolean>} value1) - (\= {#/.Number <number>} value2) - (\= {#/.String <string>} value3) - (\= {#/.Array <array_row>} value4) - (\= {#/.Number <number>} value6)))))) + (in (and (\= {/.#Null} value0) + (\= {/.#Boolean <boolean>} value1) + (\= {/.#Number <number>} value2) + (\= {/.#String <string>} value3) + (\= {/.#Array <array_row>} value4) + (\= {/.#Number <number>} value6)))))) ))) )))) diff --git a/stdlib/source/test/lux/data/format/tar.lux b/stdlib/source/test/lux/data/format/tar.lux index 835ce822e..1ed6821f6 100644 --- a/stdlib/source/test/lux/data/format/tar.lux +++ b/stdlib/source/test/lux/data/format/tar.lux @@ -47,27 +47,27 @@ (`` ($_ _.and (_.cover [/.path /.from_path] (case (/.path expected) - {#try.Success actual} + {try.#Success actual} (text\= expected (/.from_path actual)) - {#try.Failure error} + {try.#Failure error} false)) (_.cover [/.no_path] (text\= "" (/.from_path /.no_path))) (_.cover [/.path_size /.path_is_too_long] (case (/.path invalid) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.path_is_too_long error))) (_.cover [/.not_ascii] (case (/.path not_ascii) - {#try.Success actual} + {try.#Success actual} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.not_ascii error))) ))))) @@ -82,25 +82,25 @@ (`` ($_ _.and (_.cover [/.name /.from_name] (case (/.name expected) - {#try.Success actual} + {try.#Success actual} (text\= expected (/.from_name actual)) - {#try.Failure error} + {try.#Failure error} false)) (_.cover [/.name_size /.name_is_too_long] (case (/.name invalid) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.name_is_too_long error))) (_.cover [/.not_ascii] (case (/.name not_ascii) - {#try.Success actual} + {try.#Success actual} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.not_ascii error))) ))))) @@ -113,18 +113,18 @@ (`` ($_ _.and (_.cover [/.small /.from_small] (case (/.small expected) - {#try.Success actual} + {try.#Success actual} (n.= expected (/.from_small actual)) - {#try.Failure error} + {try.#Failure error} false)) (_.cover [/.small_limit /.not_a_small_number] (case (/.small invalid) - {#try.Success actual} + {try.#Success actual} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.not_a_small_number error))) ))))) @@ -137,18 +137,18 @@ (`` ($_ _.and (_.cover [/.big /.from_big] (case (/.big expected) - {#try.Success actual} + {try.#Success actual} (n.= expected (/.from_big actual)) - {#try.Failure error} + {try.#Failure error} false)) (_.cover [/.big_limit /.not_a_big_number] (case (/.big invalid) - {#try.Success actual} + {try.#Success actual} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.not_a_big_number error))) ))))) @@ -183,8 +183,8 @@ false))) (try.else false)))] - [/.Symbolic_Link #/.Symbolic_Link] - [/.Directory #/.Directory] + [/.Symbolic_Link /.#Symbolic_Link] + [/.Directory /.#Directory] )) (_.for [/.File /.Content /.content /.data] ($_ _.and @@ -196,10 +196,10 @@ tar (|> (row.row {<tag> [expected_path expected_moment /.none - [#/.user [#/.name /.anonymous - #/.id /.no_id] - #/.group [#/.name /.anonymous - #/.id /.no_id]] + [/.#user [/.#name /.anonymous + /.#id /.no_id] + /.#group [/.#name /.anonymous + /.#id /.no_id]] expected_content]}) (format.result /.writer) (<b>.result /.parser))] @@ -218,8 +218,8 @@ false))) (try.else false)))] - [/.Normal #/.Normal] - [/.Contiguous #/.Contiguous] + [/.Normal /.#Normal] + [/.Contiguous /.#Contiguous] )))))))) (def: random_mode @@ -251,18 +251,18 @@ (|> (do try.monad [path (/.path path) content (/.content (binary.empty 0)) - tar (|> (row.row {#/.Normal [path + tar (|> (row.row {/.#Normal [path (instant.of_millis +0) expected_mode - [#/.user [#/.name /.anonymous - #/.id /.no_id] - #/.group [#/.name /.anonymous - #/.id /.no_id]] + [/.#user [/.#name /.anonymous + /.#id /.no_id] + /.#group [/.#name /.anonymous + /.#id /.no_id]] content]}) (format.result /.writer) (<b>.result /.parser))] (in (case (row.list tar) - (^ (list {#/.Normal [_ _ actual_mode _ _]})) + (^ (list {/.#Normal [_ _ actual_mode _ _]})) (n.= (/.mode expected_mode) (/.mode actual_mode)) @@ -274,18 +274,18 @@ (|> (do try.monad [path (/.path path) content (/.content (binary.empty 0)) - tar (|> (row.row {#/.Normal [path + tar (|> (row.row {/.#Normal [path (instant.of_millis +0) <expected_mode> - [#/.user [#/.name /.anonymous - #/.id /.no_id] - #/.group [#/.name /.anonymous - #/.id /.no_id]] + [/.#user [/.#name /.anonymous + /.#id /.no_id] + /.#group [/.#name /.anonymous + /.#id /.no_id]] content]}) (format.result /.writer) (<b>.result /.parser))] (in (case (row.list tar) - (^ (list {#/.Normal [_ _ actual_mode _ _]})) + (^ (list {/.#Normal [_ _ actual_mode _ _]})) (n.= (/.mode <expected_mode>) (/.mode actual_mode)) @@ -324,39 +324,39 @@ ($_ _.and (_.cover [/.name_size /.name_is_too_long] (case (/.name invalid) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.name_is_too_long error))) (_.cover [/.not_ascii] (case (/.name not_ascii) - {#try.Success actual} + {try.#Success actual} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.not_ascii error))) (_.cover [/.Name /.name /.from_name] (|> (do try.monad [path (/.path path) content (/.content (binary.empty 0)) expected (/.name expected) - tar (|> (row.row {#/.Normal [path + tar (|> (row.row {/.#Normal [path (instant.of_millis +0) /.none - [#/.user [#/.name expected - #/.id /.no_id] - #/.group [#/.name /.anonymous - #/.id /.no_id]] + [/.#user [/.#name expected + /.#id /.no_id] + /.#group [/.#name /.anonymous + /.#id /.no_id]] content]}) (format.result /.writer) (<b>.result /.parser))] (in (case (row.list tar) - (^ (list {#/.Normal [_ _ _ actual_ownership _]})) + (^ (list {/.#Normal [_ _ _ actual_ownership _]})) (and (text\= (/.from_name expected) - (/.from_name (value@ [#/.user #/.name] actual_ownership))) + (/.from_name (value@ [/.#user /.#name] actual_ownership))) (text\= (/.from_name /.anonymous) - (/.from_name (value@ [#/.group #/.name] actual_ownership)))) + (/.from_name (value@ [/.#group /.#name] actual_ownership)))) _ false))) @@ -365,26 +365,26 @@ (|> (do try.monad [path (/.path path) content (/.content (binary.empty 0)) - tar (|> (row.row {#/.Normal [path + tar (|> (row.row {/.#Normal [path (instant.of_millis +0) /.none - [#/.user [#/.name /.anonymous - #/.id /.no_id] - #/.group [#/.name /.anonymous - #/.id /.no_id]] + [/.#user [/.#name /.anonymous + /.#id /.no_id] + /.#group [/.#name /.anonymous + /.#id /.no_id]] content]}) (format.result /.writer) (<b>.result /.parser))] (in (case (row.list tar) - (^ (list {#/.Normal [_ _ _ actual_ownership _]})) + (^ (list {/.#Normal [_ _ _ actual_ownership _]})) (and (text\= (/.from_name /.anonymous) - (/.from_name (value@ [#/.user #/.name] actual_ownership))) + (/.from_name (value@ [/.#user /.#name] actual_ownership))) (n.= (/.from_small /.no_id) - (/.from_small (value@ [#/.user #/.id] actual_ownership))) + (/.from_small (value@ [/.#user /.#id] actual_ownership))) (text\= (/.from_name /.anonymous) - (/.from_name (value@ [#/.group #/.name] actual_ownership))) + (/.from_name (value@ [/.#group /.#name] actual_ownership))) (n.= (/.from_small /.no_id) - (/.from_small (value@ [#/.group #/.id] actual_ownership)))) + (/.from_small (value@ [/.#group /.#id] actual_ownership)))) _ false))) @@ -407,10 +407,10 @@ (_.cover [/.invalid_end_of_archive] (let [dump (format.result /.writer row.empty)] (case (<b>.result /.parser (binary\composite dump dump)) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.invalid_end_of_archive error)))) ..path diff --git a/stdlib/source/test/lux/data/name.lux b/stdlib/source/test/lux/data/name.lux index ca5201761..dd9171e99 100644 --- a/stdlib/source/test/lux/data/name.lux +++ b/stdlib/source/test/lux/data/name.lux @@ -65,10 +65,5 @@ (and (/\= [.prelude_module "yolo"] (.name_of .yolo)) (/\= ["test/lux/data/name" "yolo"] (.name_of ..yolo)) (/\= ["" "yolo"] (.name_of yolo)) - (/\= ["library/lux/test" "yolo"] (.name_of library/lux/test.yolo)))) - (_.test "Can obtain Name from tag." - (and (/\= [.prelude_module "yolo"] (.name_of #.yolo)) - (/\= ["test/lux/data/name" "yolo"] (.name_of #..yolo)) - (/\= ["" "yolo"] (.name_of #yolo)) - (/\= ["library/lux/test" "yolo"] (.name_of #library/lux/test.yolo))))))) + (/\= ["library/lux/test" "yolo"] (.name_of library/lux/test.yolo))))))) ))))) diff --git a/stdlib/source/test/lux/data/sum.lux b/stdlib/source/test/lux/data/sum.lux index bc1d9c70c..353c6f6c2 100644 --- a/stdlib/source/test/lux/data/sum.lux +++ b/stdlib/source/test/lux/data/sum.lux @@ -37,9 +37,9 @@ (_.cover [/.hash] (let [hash (/.hash i.hash n.hash)] (and (n.= (\ i.hash hash left) - (\ hash hash {#.Left left})) + (\ hash hash {.#Left left})) (n.= (\ n.hash hash right) - (\ hash hash {#.Right right})))))) + (\ hash hash {.#Right right})))))) (_.cover [/.left] (|> (/.left expected) diff --git a/stdlib/source/test/lux/data/text.lux b/stdlib/source/test/lux/data/text.lux index 305268a0b..b53d4b83b 100644 --- a/stdlib/source/test/lux/data/text.lux +++ b/stdlib/source/test/lux/data/text.lux @@ -152,15 +152,15 @@ expected (\ ! each (n.% size) random.nat)] (_.cover [/.char] (case (/.char expected sample) - {#.Some char} + {.#Some char} (case (/.index (/.of_char char) sample) - {#.Some actual} + {.#Some actual} (n.= expected actual) _ false) - #.None + {.#None} false))) (_.cover [/.space /.space?] (`` (and (~~ (template [<char>] @@ -210,11 +210,11 @@ (/.replaced/1 pre post (\ /.monoid composite pre static)))) (_.cover [/.split_by] (case (/.split_by static ($_ (\ /.monoid composite) pre static post)) - {#.Some [left right]} + {.#Some [left right]} (and (\ /.equivalence = pre left) (\ /.equivalence = post right)) - #.None + {.#None} false)) (_.cover [/.lower_cased] (let [effectiveness! @@ -290,7 +290,7 @@ ($_ _.and (_.cover [/.split_at] (|> (/.split_at sizeL sample) - (case> {#.Right [_l _r]} + (case> {.#Right [_l _r]} (and (/\= sampleL _l) (/\= sampleR _r) (/\= sample (/.together (list _l _r)))) @@ -302,7 +302,7 @@ (/.clip sizeL (n.- sizeL (/.size sample)) sample) (/.clip_since sizeL sample) (/.clip_since 0 sample)] - (case> [{#.Right _l} {#.Right _r} {#.Right _r'} {#.Right _f}] + (case> [{.#Right _l} {.#Right _r} {.#Right _r'} {.#Right _f}] (and (/\= sampleL _l) (/\= sampleR _r) (/\= _r _r') diff --git a/stdlib/source/test/lux/data/text/escape.lux b/stdlib/source/test/lux/data/text/escape.lux index 6a658d960..edce881aa 100644 --- a/stdlib/source/test/lux/data/text/escape.lux +++ b/stdlib/source/test/lux/data/text/escape.lux @@ -105,11 +105,11 @@ (/.escapable? right)) (let [escaped (/.escaped expected)] (case (/.un_escaped escaped) - {#try.Success un_escaped} + {try.#Success un_escaped} (and (not (text\= escaped expected)) (text\= un_escaped expected)) - {#try.Failure error} + {try.#Failure error} false)) (text\= expected (/.escaped expected)))))) (do [! random.monad] @@ -117,10 +117,10 @@ (\ ! each text.of_char))] (_.cover [/.dangling_escape] (case (/.un_escaped (format (/.escaped dummy) "\")) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.dangling_escape error)))) (do [! random.monad] [dummy (|> (random.char unicode.character) @@ -128,10 +128,10 @@ (\ ! each text.of_char))] (_.cover [/.invalid_escape] (case (/.un_escaped (format "\" dummy)) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.invalid_escape error)))) (do [! random.monad] [too_short (|> (random.char unicode.character) @@ -139,15 +139,15 @@ code (|> (random.unicode 4) (random.only (function (_ code) (case (\ n.hex decoded code) - {#try.Failure error} true - {#try.Success _} false))))] + {try.#Failure error} true + {try.#Success _} false))))] (_.cover [/.invalid_unicode_escape] (template.let [(!invalid <code>) [(case (/.un_escaped (format "\u" <code>)) - {#try.Success _} + {try.#Success _} false - {#try.Failure error} + {try.#Failure error} (exception.match? /.invalid_unicode_escape error))]] (and (!invalid (\ n.hex encoded too_short)) (!invalid code))))) diff --git a/stdlib/source/test/lux/data/text/format.lux b/stdlib/source/test/lux/data/text/format.lux index ddd4d0afb..14883a7ff 100644 --- a/stdlib/source/test/lux/data/text/format.lux +++ b/stdlib/source/test/lux/data/text/format.lux @@ -167,10 +167,10 @@ [sample (random.maybe random.nat)] (_.cover [/.maybe] (case sample - #.None + {.#None} true - {#.Some value} + {.#Some value} (text.contains? (/.nat value) (/.maybe /.nat sample))))) (do [! random.monad] diff --git a/stdlib/source/test/lux/data/text/regex.lux b/stdlib/source/test/lux/data/text/regex.lux index 554a47eff..cb766f27b 100644 --- a/stdlib/source/test/lux/data/text/regex.lux +++ b/stdlib/source/test/lux/data/text/regex.lux @@ -26,7 +26,7 @@ (-> (Parser Text) Text Bit) (|> input (<text>.result regex) - (case> {#try.Success parsed} + (case> {try.#Success parsed} (text\= parsed input) _ @@ -36,7 +36,7 @@ (-> Text (Parser Text) Text Bit) (|> input (<text>.result regex) - (case> {#try.Success parsed} + (case> {try.#Success parsed} (text\= test parsed) _ @@ -46,7 +46,7 @@ (All (_ a) (-> (Parser a) Text Bit)) (|> input (<text>.result regex) - (case> {#try.Failure _} + (case> {try.#Failure _} true _ @@ -58,7 +58,7 @@ (macro.with_identifiers [g!message g!_] (in (list (` (|> (~ input) (<text>.result (~ regex)) - (case> (^ {#try.Success (~ pattern)}) + (case> (^ {try.#Success (~ pattern)}) true (~ g!_) @@ -274,11 +274,11 @@ (syntax: (expands? [form <code>.any]) (function (_ lux) - {#try.Success [lux (list (code.bit (case (macro.single_expansion form lux) - {#try.Success _} + {try.#Success [lux (list (code.bit (case (macro.single_expansion form lux) + {try.#Success _} true - {#try.Failure error} + {try.#Failure error} false)))]})) (def: .public test |