diff options
author | Eduardo Julian | 2019-03-28 20:15:40 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-03-28 20:15:40 -0400 |
commit | a869f51e0ea3fe0c224de1188ad5bbd5db080f47 (patch) | |
tree | 5593245881ce62156e0603701479ad1db38c6134 /stdlib/source/test/lux/world | |
parent | 023b761c13744ccfe65090b0f4e10640093faa03 (diff) |
Fixed some tests.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/world/binary.lux | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/stdlib/source/test/lux/world/binary.lux b/stdlib/source/test/lux/world/binary.lux index 2f347c50d..2e463ea4b 100644 --- a/stdlib/source/test/lux/world/binary.lux +++ b/stdlib/source/test/lux/world/binary.lux @@ -39,9 +39,11 @@ (def: (bits-io bytes read write value) (-> Nat (-> Nat Binary (Error Nat)) (-> Nat Nat Binary (Error Any)) Nat Bit) - (let [binary (/.create 8) - bits (n/* 8 bytes) - capped-value (|> 1 (i64.left-shift bits) dec (i64.and value))] + (let [binary (/.create bytes) + cap (case bytes + 8 (dec 0) + _ (|> 1 (i64.left-shift (n/* 8 bytes)) dec)) + capped-value (i64.and cap value)] (succeed (do error.monad [_ (write 0 value binary) |