diff options
Diffstat (limited to 'stdlib/source/test/lux/control/parser/binary.lux')
-rw-r--r-- | stdlib/source/test/lux/control/parser/binary.lux | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/stdlib/source/test/lux/control/parser/binary.lux b/stdlib/source/test/lux/control/parser/binary.lux index 40e2fa301..7b57b1547 100644 --- a/stdlib/source/test/lux/control/parser/binary.lux +++ b/stdlib/source/test/lux/control/parser/binary.lux @@ -56,10 +56,10 @@ (|> value (\ utf8.codec encoded) (\ utf8.codec decoded) - (case> {#try.Success converted} + (case> {try.#Success converted} (text\= value converted) - {#try.Failure error} + {try.#Failure error} false))) (def: random_text @@ -105,7 +105,6 @@ random.safe_frac ..random_text ..random_name - ..random_name random_sequence random_sequence random_sequence @@ -131,7 +130,7 @@ (_.cover [<size> <parser> <format>] (|> (format.result <format> expected) (/.result <parser>) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (n.= (.nat expected) (.nat actual)))))))] @@ -150,7 +149,7 @@ (_.cover [<parser> <format>] (|> (format.result <format> expected) (/.result <parser>) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ binary.equivalence = expected actual))))))] [/.binary/8 format.binary/8] @@ -168,7 +167,7 @@ (_.cover [<parser> <format>] (|> (format.result <format> expected) (/.result <parser>) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ text.equivalence = expected actual))))))] [/.utf8/8 format.utf8/8] @@ -188,7 +187,7 @@ (|> expected (format.result (<format> format.nat)) (/.result (<parser> /.nat)) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ (row.equivalence n.equivalence) = expected actual))))))] [/.row/8 format.row/8] @@ -207,7 +206,7 @@ (|> expected (format.result <format>) (/.result <parser>) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ <equivalence> = expected actual))))))] [/.bit format.bit random.bit bit.equivalence] @@ -220,7 +219,7 @@ (|> expected (format.result format.frac) (/.result /.frac) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (or (\ frac.equivalence = expected actual) (and (frac.not_a_number? expected) (frac.not_a_number? actual)))))))) @@ -232,7 +231,7 @@ (|> expected (format.result format.bits/8) (/.result /.bit) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.not_a_bit error)))))) ))) @@ -246,7 +245,7 @@ (|> expected (format.result <format>) (/.result <parser>) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ <equivalence> = expected actual))))))] [/.location format.location random_location location_equivalence] @@ -260,7 +259,7 @@ (|> expected (format.result <format>) (/.result <parser>) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ <equivalence> = expected actual))))))] [/.maybe (/.maybe /.nat) format.maybe (format.maybe format.nat) (random.maybe random.nat) (maybe.equivalence n.equivalence)] @@ -273,7 +272,7 @@ (|> expected (format.result (format.list format.nat)) (/.result (/.set n.hash /.nat)) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.set_elements_are_not_unique error)))))) (do [! random.monad] [expected (random.or random.bit random.nat)] @@ -282,7 +281,7 @@ (format.result (format.or format.bit format.nat)) (/.result (: (/.Parser (Either Bit Nat)) (/.or /.bit /.nat))) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ (sum.equivalence bit.equivalence n.equivalence) = expected actual)))))) @@ -296,7 +295,7 @@ (format.result (format.and format.bits/8 format.bit)) (/.result (: (/.Parser (Either Bit Nat)) (/.or /.bit /.nat))) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.invalid_tag error)))))) (do [! random.monad] [expected (random.list ..segment_size random.nat)] @@ -310,7 +309,7 @@ (/.or /.any (<>.and /.nat recur)))))) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ (list.equivalence n.equivalence) = expected actual)))))) @@ -325,13 +324,13 @@ format.no_op format.instance] (|> (format.instance format.no_op) (/.result /.any) - (!expect {#try.Success _}))) + (!expect {try.#Success _}))) (do [! random.monad] [data (\ ! each (\ utf8.codec encoded) (random.ascii ..segment_size))] (_.cover [/.binary_was_not_fully_read] (|> data (/.result /.any) - (!expect (^multi {#try.Failure error} + (!expect (^multi {try.#Failure error} (exception.match? /.binary_was_not_fully_read error)))))) (do [! random.monad] [expected (\ ! each (\ utf8.codec encoded) (random.ascii ..segment_size))] @@ -339,7 +338,7 @@ (|> expected (format.result (format.segment ..segment_size)) (/.result (/.segment ..segment_size)) - (!expect (^multi {#try.Success actual} + (!expect (^multi {try.#Success actual} (\ binary.equivalence = expected actual)))))) (do [! random.monad] [data (\ ! each (\ utf8.codec encoded) (random.ascii ..segment_size))] @@ -351,7 +350,7 @@ post /.end?] (in (and (not pre) post)))) - (!expect {#try.Success #1})))) + (!expect {try.#Success #1})))) (do [! random.monad] [to_read (\ ! each (n.% (++ ..segment_size)) random.nat) data (\ ! each (\ utf8.codec encoded) (random.ascii ..segment_size))] @@ -366,7 +365,7 @@ (in (and (n.= 0 start) (n.= to_read offset) (n.= ..segment_size nothing_left))))) - (!expect {#try.Success #1})))) + (!expect {try.#Success #1})))) (do [! random.monad] [to_read (\ ! each (n.% (++ ..segment_size)) random.nat) data (\ ! each (\ utf8.codec encoded) (random.ascii ..segment_size))] @@ -380,7 +379,7 @@ (in (and (n.= ..segment_size (n.+ to_read remaining)) (n.= 0 nothing_left))))) - (!expect {#try.Success #1})))) + (!expect {try.#Success #1})))) ..size ..binary ..utf8 |