aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorPhilip Nelson <me@pnelson.ca>2024-06-14 18:15:31 -0700
committerPhilip Nelson <me@pnelson.ca>2024-06-14 18:15:31 -0700
commit16a3c85baa350714742e83e6aea1d05766c8d1d9 (patch)
treee888fc736dca994a778a12e90bca95c9cd9e9bb1 /test
parentAddress #1452 - Partial revert some changes from #1391 (diff)
Fix buffer push uint max
Diffstat (limited to 'test')
-rw-r--r--test/suite-buffer.janet12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/suite-buffer.janet b/test/suite-buffer.janet
index b6ceecec..28fb83d5 100644
--- a/test/suite-buffer.janet
+++ b/test/suite-buffer.janet
@@ -85,9 +85,9 @@
(buffer/push-uint16 buffer-uint16-le :le 0x0102)
(assert (= "\x02\x01" (string buffer-uint16-le)) "buffer/push-uint16 little endian")
-(def buffer-uint16-negative @"")
-(buffer/push-uint16 buffer-uint16-negative :be -1)
-(assert (= "\xff\xff" (string buffer-uint16-negative)) "buffer/push-uint16 negative")
+(def buffer-uint16-max @"")
+(buffer/push-uint16 buffer-uint16-max :be 0xFFFF)
+(assert (= "\xff\xff" (string buffer-uint16-max)) "buffer/push-uint16 max")
(def buffer-uint32-be @"")
(buffer/push-uint32 buffer-uint32-be :be 0x01020304)
@@ -97,9 +97,9 @@
(buffer/push-uint32 buffer-uint32-le :le 0x01020304)
(assert (= "\x04\x03\x02\x01" (string buffer-uint32-le)) "buffer/push-uint32 little endian")
-(def buffer-uint32-negative @"")
-(buffer/push-uint32 buffer-uint32-negative :be -1)
-(assert (= "\xff\xff\xff\xff" (string buffer-uint32-negative)) "buffer/push-uint32 negative")
+(def buffer-uint32-max @"")
+(buffer/push-uint32 buffer-uint32-max :be 0xFFFFFFFF)
+(assert (= "\xff\xff\xff\xff" (string buffer-uint32-max)) "buffer/push-uint32 max")
(def buffer-float32-be @"")
(buffer/push-float32 buffer-float32-be :be 1.234)