summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-05-21 07:20:31 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-05-21 07:20:31 -0700
commit9feb788b7f30fbe9e4654be22daede9924f20603 (patch)
tree3e4187eeec72424cc62d6c9ee6f21b1bfa4ab363 /tests
parente3993c39133c73ba981f7cf5f74c758f47927387 (diff)
downloadtxr-9feb788b7f30fbe9e4654be22daede9924f20603.tar.gz
txr-9feb788b7f30fbe9e4654be22daede9924f20603.tar.bz2
txr-9feb788b7f30fbe9e4654be22daede9924f20603.zip
match: binary-integer conv tests for #x-8000...
* tests/016/arith.tl: Test providing coverage for the most negative two's complement integer, #x-800...00 in various sizes. The 64 bit cases are failing.
Diffstat (limited to 'tests')
-rw-r--r--tests/016/arith.tl21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/016/arith.tl b/tests/016/arith.tl
index 1609833f..43efb6bb 100644
--- a/tests/016/arith.tl
+++ b/tests/016/arith.tl
@@ -121,3 +121,24 @@
#xAABBCCDDEE)
(test (ffi-get #b'000000AABBCCDDEE' (ffi be-int64))
#xAABBCCDDEE)
+
+(test (mequal (ffi-put #x-8000 (ffi int16))
+ #b'0080'
+ #b'8000') t)
+
+(test (ffi-get (ffi-put #x-8000 (ffi int16)) (ffi int16))
+ #x-8000)
+
+(test (mequal (ffi-put #x-80000000 (ffi int32))
+ #b'00000080'
+ #b'80000000') t)
+
+(test (ffi-get (ffi-put #x-80000000 (ffi int32)) (ffi int32))
+ #x-80000000)
+
+(test (mequal (ffi-put #x-8000000000000000 (ffi int64))
+ #b'0000000000000080'
+ #b'8000000000000000') t)
+
+(test (ffi-get (ffi-put #x-8000000000000000 (ffi int64)) (ffi int64))
+ #x-8000000000000000)