diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/data/binary.lux | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/stdlib/source/test/lux/data/binary.lux b/stdlib/source/test/lux/data/binary.lux index 25877dfd7..656dbf9bf 100644 --- a/stdlib/source/test/lux/data/binary.lux +++ b/stdlib/source/test/lux/data/binary.lux @@ -42,7 +42,7 @@ (if (n.< size idx) (do random.monad [byte random.nat] - (exec (try.trusted (/.has/1! idx byte output)) + (exec (try.trusted (/.has_8! idx byte output)) (again (++ idx)))) (# random.monad in output))))) @@ -115,10 +115,10 @@ (and (n.= 0 pre) (n.= capped_value post))))] - [0 !.bytes/1 !.has/1!] - [1 !.bytes/2 !.has/2!] - [2 !.bytes/4 !.has/4!] - [3 !.bytes/8 !.has/8!])) + [0 !.bits_8 !.has_8!] + [1 !.bits_16 !.has_16!] + [2 !.bits_32 !.has_32!] + [3 !.bits_64 !.has_64!])) (_.cover [!.slice] (let [random_slice (!.slice offset length sample) idxs (is (List Nat) @@ -126,7 +126,7 @@ 0 (list) _ (enum.range n.enum 0 (-- length)))) reader (function (_ binary idx) - (!.bytes/1 idx binary))] + (!.bits_8 idx binary))] (and (n.= length (!.size random_slice)) (# (list.equivalence n.equivalence) = (list#each (|>> (n.+ offset) (reader sample)) idxs) @@ -135,10 +135,10 @@ (and (let [it (!.copy! size 0 sample 0 (!.empty size))] (and (not (same? sample it)) (!.= sample it))) - (let [sample/0 (!.bytes/1 0 sample) + (let [sample/0 (!.bits_8 0 sample) copy (!.copy! 1 0 sample 0 (!.empty 2)) - copy/0 (!.bytes/1 0 copy) - copy/1 (!.bytes/1 1 copy)] + copy/0 (!.bits_8 0 copy) + copy/1 (!.bits_8 1 copy)] (and (n.= sample/0 copy/0) (n.= 0 copy/1))))) ))))) @@ -172,14 +172,14 @@ (|> (/.empty size) /.size (n.= size))) (_.for [/.index_out_of_bounds] ($_ _.and - (_.cover [/.bytes/1 /.has/1!] - (..binary_io 0 /.bytes/1 /.has/1! value)) - (_.cover [/.bytes/2 /.has/2!] - (..binary_io 1 /.bytes/2 /.has/2! value)) - (_.cover [/.bytes/4 /.has/4!] - (..binary_io 2 /.bytes/4 /.has/4! value)) - (_.cover [/.bytes/8 /.has/8!] - (..binary_io 3 /.bytes/8 /.has/8! value)))) + (_.cover [/.bits_8 /.has_8!] + (..binary_io 0 /.bits_8 /.has_8! value)) + (_.cover [/.bits_16 /.has_16!] + (..binary_io 1 /.bits_16 /.has_16! value)) + (_.cover [/.bits_32 /.has_32!] + (..binary_io 2 /.bits_32 /.has_32! value)) + (_.cover [/.bits_64 /.has_64!] + (..binary_io 3 /.bits_64 /.has_64! value)))) (_.cover [/.slice] (let [random_slice (try.trusted (/.slice offset length sample)) idxs (is (List Nat) @@ -187,7 +187,7 @@ 0 (list) _ (enum.range n.enum 0 (-- length)))) reader (function (_ binary idx) - (/.bytes/1 idx binary))] + (/.bits_8 idx binary))] (and (n.= length (/.size random_slice)) (case [(monad.each try.monad (|>> (n.+ offset) (reader sample)) idxs) (monad.each try.monad (reader random_slice) idxs)] @@ -223,10 +223,10 @@ false) (succeed (do try.monad - [sample/0 (/.bytes/1 0 sample) + [sample/0 (/.bits_8 0 sample) copy (/.copy! 1 0 sample 0 (/.empty 2)) - copy/0 (/.bytes/1 0 copy) - copy/1 (/.bytes/1 1 copy)] + copy/0 (/.bits_8 0 copy) + copy/1 (/.bits_8 1 copy)] (in (and (n.= sample/0 copy/0) (n.= 0 copy/1))))))) (_.cover [/.cannot_copy] |