aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/data
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/data')
-rw-r--r--stdlib/source/test/lux/data/binary.lux18
-rw-r--r--stdlib/source/test/lux/data/collection/array.lux16
-rw-r--r--stdlib/source/test/lux/data/collection/dictionary.lux26
-rw-r--r--stdlib/source/test/lux/data/collection/dictionary/ordered.lux6
-rw-r--r--stdlib/source/test/lux/data/collection/list.lux14
-rw-r--r--stdlib/source/test/lux/data/collection/queue.lux4
-rw-r--r--stdlib/source/test/lux/data/collection/queue/priority.lux4
-rw-r--r--stdlib/source/test/lux/data/collection/row.lux8
-rw-r--r--stdlib/source/test/lux/data/collection/set/ordered.lux2
-rw-r--r--stdlib/source/test/lux/data/collection/stack.lux6
-rw-r--r--stdlib/source/test/lux/data/collection/tree/finger.lux10
-rw-r--r--stdlib/source/test/lux/data/format/json.lux34
-rw-r--r--stdlib/source/test/lux/data/format/tar.lux86
-rw-r--r--stdlib/source/test/lux/data/sum.lux12
-rw-r--r--stdlib/source/test/lux/data/text.lux10
-rw-r--r--stdlib/source/test/lux/data/text/escape.lux20
-rw-r--r--stdlib/source/test/lux/data/text/format.lux2
-rw-r--r--stdlib/source/test/lux/data/text/regex.lux26
18 files changed, 152 insertions, 152 deletions
diff --git a/stdlib/source/test/lux/data/binary.lux b/stdlib/source/test/lux/data/binary.lux
index 1fb97272c..d301efd1c 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)
_
@@ -141,16 +141,16 @@
#.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 46783bc56..243d77203 100644
--- a/stdlib/source/test/lux/data/collection/array.lux
+++ b/stdlib/source/test/lux/data/collection/array.lux
@@ -65,9 +65,9 @@
(/.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))
@@ -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))
@@ -199,7 +199,7 @@
(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!]
diff --git a/stdlib/source/test/lux/data/collection/dictionary.lux b/stdlib/source/test/lux/data/collection/dictionary.lux
index 788f6c3eb..2f8a58bfc 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!)))
@@ -192,7 +192,7 @@
#.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,7 +209,7 @@
(_.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
@@ -220,9 +220,9 @@
#.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
diff --git a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux
index 65bb6226d..94dd0e61d 100644
--- a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux
+++ b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux
@@ -78,7 +78,7 @@
[#.None #.None]
#1
- [(#.Some reference) (#.Some sample)]
+ [{#.Some reference} {#.Some sample}]
(n.= reference sample)
_
@@ -88,7 +88,7 @@
[#.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 e4776e1ab..b2411ce74 100644
--- a/stdlib/source/test/lux/data/collection/list.lux
+++ b/stdlib/source/test/lux/data/collection/list.lux
@@ -168,7 +168,7 @@
(_.cover [/.item]
(/.every? (function (_ [index expected])
(case (/.item index sample)
- (#.Some actual)
+ {#.Some actual}
(n.= expected actual)
#.None
@@ -238,7 +238,7 @@
[($_ _.and
(_.cover [<head>]
(case [(<pre> sample) (<head> sample)]
- [(#.Item expected _) (#.Some actual)]
+ [{#.Item expected _} {#.Some actual}]
(n.= expected actual)
[#.End #.None]
@@ -248,7 +248,7 @@
false))
(_.cover [<tail>]
(case [(<pre> sample) (<tail> sample)]
- [(#.Item _ expected) (#.Some actual)]
+ [{#.Item _ expected} {#.Some actual}]
(/\= (<pre> expected) actual)
[#.End #.None]
@@ -355,7 +355,7 @@
choose (: (-> Nat (Maybe Text))
(function (_ value)
(if (n.even? value)
- (#.Some (\ n.decimal encoded value))
+ {#.Some (\ n.decimal encoded value)}
#.None)))]
(do [! random.monad]
[sample ..random]
@@ -366,7 +366,7 @@
(/\each (\ n.decimal encoded))
/.head)
(/.one choose sample)]
- [(#.Some expected) (#.Some actual)]
+ [{#.Some expected} {#.Some actual}]
(text\= expected actual)
[#.None #.None]
@@ -382,7 +382,7 @@
(/.all choose sample)))
(_.cover [/.example]
(case (/.example n.even? sample)
- (#.Some found)
+ {#.Some found}
(n.even? found)
#.None
@@ -419,7 +419,7 @@
(/\= (/.indices size)
(/.iterations (function (_ index)
(if (n.< size index)
- (#.Some (++ index))
+ {#.Some (++ index)}
#.None))
0)))))
(_.cover [/.mixes]
diff --git a/stdlib/source/test/lux/data/collection/queue.lux b/stdlib/source/test/lux/data/collection/queue.lux
index 117617468..795806329 100644
--- a/stdlib/source/test/lux/data/collection/queue.lux
+++ b/stdlib/source/test/lux/data/collection/queue.lux
@@ -60,7 +60,7 @@
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]
@@ -95,7 +95,7 @@
has_expected_order!)))
(_.cover [/.next]
(case members
- (#.Item target expected)
+ {#.Item target expected}
(let [popped (/.next sample)
size_decreases!
diff --git a/stdlib/source/test/lux/data/collection/queue/priority.lux b/stdlib/source/test/lux/data/collection/queue/priority.lux
index 0ce7111f6..6ec5cb958 100644
--- a/stdlib/source/test/lux/data/collection/queue/priority.lux
+++ b/stdlib/source/test/lux/data/collection/queue/priority.lux
@@ -49,14 +49,14 @@
(/.empty? /.empty))
(_.cover [/.front]
(case (/.front sample)
- (#.Some first)
+ {#.Some first}
(n.> 0 (/.size sample))
#.None
(/.empty? sample)))
(_.cover [/.member?]
(case (/.front sample)
- (#.Some first)
+ {#.Some first}
(/.member? n.equivalence sample first)
#.None
diff --git a/stdlib/source/test/lux/data/collection/row.lux b/stdlib/source/test/lux/data/collection/row.lux
index fa4f7271f..684619006 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 b89bad1bb..89ad780c7 100644
--- a/stdlib/source/test/lux/data/collection/set/ordered.lux
+++ b/stdlib/source/test/lux/data/collection/set/ordered.lux
@@ -74,7 +74,7 @@
(~~ (template [<coverage> <comparison>]
[(_.cover [<coverage>]
(case (<coverage> setL)
- (#.Some value)
+ {#.Some value}
(|> setL /.list (list.every? (<comparison> value)))
#.None
diff --git a/stdlib/source/test/lux/data/collection/stack.lux b/stdlib/source/test/lux/data/collection/stack.lux
index eb05c1e67..928dc475a 100644
--- a/stdlib/source/test/lux/data/collection/stack.lux
+++ b/stdlib/source/test/lux/data/collection/stack.lux
@@ -48,20 +48,20 @@
#.None
(/.empty? sample)
- (#.Some _)
+ {#.Some _}
(not (/.empty? sample))))
(_.cover [/.next]
(case (/.next sample)
#.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))
diff --git a/stdlib/source/test/lux/data/collection/tree/finger.lux b/stdlib/source/test/lux/data/collection/tree/finger.lux
index a929dbaa5..c067ba36c 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 82faaba7f..1e5015f46 100644
--- a/stdlib/source/test/lux/data/format/json.lux
+++ b/stdlib/source/test/lux/data/format/json.lux
@@ -96,12 +96,12 @@
($_ _.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!))))))
@@ -139,7 +139,7 @@
[key (random.ascii/alpha 1)
value <random>]
(_.cover [<type> <field>]
- (|> (/.object (list [key (<tag> value)]))
+ (|> (/.object (list [key {<tag> value}]))
(<field> key)
(try\each (\ <equivalence> = value))
(try.else false))))]
@@ -154,9 +154,9 @@
<number> (number)
<string> (string)
<array_row> (row.row #/.Null
- (#/.Boolean <boolean>)
- (#/.Number <number>)
- (#/.String <string>))
+ {#/.Boolean <boolean>}
+ {#/.Number <number>}
+ {#/.String <string>})
<key0> (string)
<key1> (string)
<key2> (string)
@@ -167,13 +167,13 @@
(_.cover [/.json]
(and (\= #/.Null (/.json #null))
(~~ (template [<tag> <value>]
- [(\= (<tag> <value>) (/.json <value>))]
+ [(\= {<tag> <value>} (/.json <value>))]
[#/.Boolean <boolean>]
[#/.Number <number>]
[#/.String <string>]
))
- (\= (#/.Array <array_row>) (/.json [#null <boolean> <number> <string>]))
+ (\= {#/.Array <array_row>} (/.json [#null <boolean> <number> <string>]))
(let [object (/.json {<key0> #null
<key1> <boolean>
<key2> <number>
@@ -190,10 +190,10 @@
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))))))
+ (\= {#/.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 d595955b1..835ce822e 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)))
)))))
@@ -171,11 +171,11 @@
[(_.cover [<type>]
(|> (do try.monad
[expected_path (/.path expected_path)
- tar (|> (row.row (<tag> expected_path))
+ tar (|> (row.row {<tag> expected_path})
(format.result /.writer)
(<b>.result /.parser))]
(in (case (row.list tar)
- (^ (list (<tag> actual_path)))
+ (^ (list {<tag> actual_path}))
(text\= (/.from_path expected_path)
(/.from_path actual_path))
@@ -193,18 +193,18 @@
(|> (do try.monad
[expected_path (/.path expected_path)
expected_content (/.content content)
- tar (|> (row.row (<tag> [expected_path
+ tar (|> (row.row {<tag> [expected_path
expected_moment
/.none
[#/.user [#/.name /.anonymous
#/.id /.no_id]
#/.group [#/.name /.anonymous
#/.id /.no_id]]
- expected_content]))
+ expected_content]})
(format.result /.writer)
(<b>.result /.parser))]
(in (case (row.list tar)
- (^ (list (<tag> [actual_path actual_moment actual_mode actual_ownership actual_content])))
+ (^ (list {<tag> [actual_path actual_moment actual_mode actual_ownership actual_content]}))
(let [seconds (: (-> Instant Int)
(|>> instant.relative (duration.ticks duration.second)))]
(and (text\= (/.from_path expected_path)
@@ -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]]
- content]))
+ 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]]
- content]))
+ 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,35 +324,35 @@
($_ _.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]]
- content]))
+ 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)))
(text\= (/.from_name /.anonymous)
@@ -365,18 +365,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)
/.none
[#/.user [#/.name /.anonymous
#/.id /.no_id]
#/.group [#/.name /.anonymous
#/.id /.no_id]]
- content]))
+ 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)))
(n.= (/.from_small /.no_id)
@@ -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/sum.lux b/stdlib/source/test/lux/data/sum.lux
index c0fae2333..bc1d9c70c 100644
--- a/stdlib/source/test/lux/data/sum.lux
+++ b/stdlib/source/test/lux/data/sum.lux
@@ -37,19 +37,19 @@
(_.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)
(: (Or Nat Nat))
- (case> (0 #0 actual) (n.= expected actual)
+ (case> {0 #0 actual} (n.= expected actual)
_ false)))
(_.cover [/.right]
(|> (/.right expected)
(: (Or Nat Nat))
- (case> (0 #1 actual) (n.= expected actual)
+ (case> {0 #1 actual} (n.= expected actual)
_ false)))
(_.cover [/.either]
(and (|> (/.left expected)
@@ -64,11 +64,11 @@
(and (|> (/.left expected)
(: (Or Nat Nat))
(/.then (n.+ shift) (n.- shift))
- (case> (0 #0 actual) (n.= (n.+ shift expected) actual) _ false))
+ (case> {0 #0 actual} (n.= (n.+ shift expected) actual) _ false))
(|> (/.right expected)
(: (Or Nat Nat))
(/.then (n.+ shift) (n.- shift))
- (case> (0 #1 actual) (n.= (n.- shift expected) actual) _ false))))
+ (case> {0 #1 actual} (n.= (n.- shift expected) actual) _ false))))
(do !
[size (\ ! each (n.% 5) random.nat)
expected (random.list size random.nat)]
diff --git a/stdlib/source/test/lux/data/text.lux b/stdlib/source/test/lux/data/text.lux
index ea5bfce13..305268a0b 100644
--- a/stdlib/source/test/lux/data/text.lux
+++ b/stdlib/source/test/lux/data/text.lux
@@ -152,9 +152,9 @@
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)
_
@@ -210,7 +210,7 @@
(/.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))
@@ -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 43242b1cf..6a658d960 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 141705e33..ddd4d0afb 100644
--- a/stdlib/source/test/lux/data/text/format.lux
+++ b/stdlib/source/test/lux/data/text/format.lux
@@ -170,7 +170,7 @@
#.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 b77909f5a..554a47eff 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!_)
@@ -259,27 +259,27 @@
Test
($_ _.and
(_.test "Can specify alternative patterns."
- (and (should_check ["a" (0 #0 [])] (/.regex "a|b") "a")
- (should_check ["b" (0 #1 [])] (/.regex "a|b") "b")
+ (and (should_check ["a" {0 #0 []}] (/.regex "a|b") "a")
+ (should_check ["b" {0 #1 []}] (/.regex "a|b") "b")
(should_fail (/.regex "a|b") "c")))
(_.test "Can have groups within alternations."
- (and (should_check ["abc" (0 #0 ["b" "c"])] (/.regex "a(.)(.)|b(.)(.)") "abc")
- (should_check ["bcd" (0 #1 ["c" "d"])] (/.regex "a(.)(.)|b(.)(.)") "bcd")
+ (and (should_check ["abc" {0 #0 ["b" "c"]}] (/.regex "a(.)(.)|b(.)(.)") "abc")
+ (should_check ["bcd" {0 #1 ["c" "d"]}] (/.regex "a(.)(.)|b(.)(.)") "bcd")
(should_fail (/.regex "a(.)(.)|b(.)(.)") "cde")
- (should_check ["123-456-7890" (0 #0 ["123" "456-7890" "456" "7890"])]
+ (should_check ["123-456-7890" {0 #0 ["123" "456-7890" "456" "7890"]}]
(/.regex "(\d{3})-((\d{3})-(\d{4}))|b(.)d")
"123-456-7890")))
))
(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)
- false)))])))
+ {#try.Failure error}
+ false)))]}))
(def: .public test
Test