diff options
Diffstat (limited to 'stdlib/source/test/lux.lux')
-rw-r--r-- | stdlib/source/test/lux.lux | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 68f155559..a072fbc25 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -464,13 +464,15 @@ )))))) (/.type: for_type/variant - #Case/0 - (#Case/1 Nat) - (#Case/2 Int Text)) + (Variant + #Case/0 + (#Case/1 Nat) + (#Case/2 Int Text))) (/.type: for_type/record - {#slot/0 Bit - #slot/1 Rev}) + (Record + {#slot/0 Bit + #slot/1 Rev})) (/.type: (for_type/all parameter) [parameter parameter]) @@ -483,7 +485,7 @@ expected_left random.nat expected_right random.nat - .let [existential_type (\ ! map (|>> #.Ex) random.nat)] + .let [existential_type (\ ! each (|>> #.Ex) random.nat)] expected/0 existential_type expected/1 existential_type] (<| (_.for [/.Type]) @@ -620,7 +622,7 @@ (n.= (n.+ left right) (!n/+ left right)))) (do {! random.monad} - [sample (\ ! map (n.% 5) random.nat)] + [sample (\ ! each (n.% 5) random.nat)] (_.cover [/.^template] (case sample (/.^template [<case>] @@ -653,12 +655,14 @@ ))) (type: Small - {#small_left Nat - #small_right Text}) + (Record + {#small_left Nat + #small_right Text})) (type: Big - {#big_left Nat - #big_right Small}) + (Record + {#big_left Nat + #big_right Small})) (def: for_slot Test @@ -886,8 +890,9 @@ ))) (type: (Pair l r) - {#left l - #right r}) + (Record + {#left l + #right r})) (template: (!pair <left> <right>) [{#left <left> @@ -896,8 +901,8 @@ (def: for_case Test (do {! random.monad} - [expected_nat (\ ! map (n.% 1) random.nat) - expected_int (\ ! map (i.% +1) random.int) + [expected_nat (\ ! each (n.% 1) random.nat) + expected_int (\ ! each (i.% +1) random.int) expected_rev (random.either (in .5) (in .25)) expected_frac (random.either (in +0.5) @@ -1003,8 +1008,8 @@ Test ($_ _.and (do random.monad - [factor (random\map (|>> (n.% 10) (n.max 1)) random.nat) - iterations (random\map (n.% 10) random.nat) + [factor (random\each (|>> (n.% 10) (n.max 1)) random.nat) + iterations (random\each (n.% 10) random.nat) .let [expected (n.* factor iterations)]] (_.cover [/.loop] (n.= expected @@ -1112,7 +1117,7 @@ let/3)) actual_locals/2 (|> locals/2 (value@ #.mappings) - (list\map product.left) + (list\each product.left) (set.of_list text.hash)) correct_locals! @@ -1134,7 +1139,7 @@ (|> captured/2 (value@ #.mappings) (plist.value name) - (maybe\map (|>> product.right is?)) + (maybe\each (|>> product.right is?)) (maybe.else false)))) correct_closure! |