Commit e9cff85595e045bf7a784fce242fdcc8ceec8fa4

Thomas de Grivel 2023-08-20T20:35:09

add tests for integer

diff --git a/test/ic3/integer.in b/test/ic3/integer.in
index bed12df..e9b034a 100644
--- a/test/ic3/integer.in
+++ b/test/ic3/integer.in
@@ -1,3 +1,63 @@
+-0b10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-0o2000000000000000000000000000000000000000000
+-0x80000000000000000000000000000000
+-0b01111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
+-0o1777777777777777777777777777777777777777777
+-0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+-0b1000000000000000000000000000000000000000000000000000000000000000
+-0o1000000000000000000000
+-0x8000000000000000
+-0b0111111111111111111111111111111111111111111111111111111111111111
+-0o0777777777777777777777
+-0x7FFFFFFFFFFFFFFF
+-0b10000000000000000000000000000000
+-0o20000000000
+-0x80000000
+-0b01111111111111111111111111111111
+-0o17777777777
+-0x7FFFFFFF
+-0b1000000000000000
+-0o100000
+-0x8000
+-0b111111111111111
+-0o77777
+-0x7FFF
+-0b10000000
+-0o200
+-0x80
+-0b1111111
+-0o177
+-0x7F
+0b11111111
+0o377
+0xFF
+0b100000000
+0o400
+0x100
+0b1111111111111111
+0o177777
+0xFFFF
+0b10000000000000000
+0o200000
+0x10000
+0b011111111111111111111111111111111
+0o37777777777
+0x0FFFFFFFF
+0b100000000000000000000000000000000
+0o40000000000
+0x100000000
+0b01111111111111111111111111111111111111111111111111111111111111111
+0o1777777777777777777777
+0x0FFFFFFFFFFFFFFFF
+0b10000000000000000000000000000000000000000000000000000000000000000
+0o2000000000000000000000
+0x10000000000000000
+0b011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
+0o3777777777777777777777777777777777777777777
+0x0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+0b100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+0o4000000000000000000000000000000000000000000
+0x100000000000000000000000000000000
 -170141183460469231731687303715884105728 + -170141183460469231731687303715884105728
 -170141183460469231731687303715884105728 + -170141183460469231731687303715884105727
 -170141183460469231731687303715884105728 + -9223372036854775808
diff --git a/test/ic3/integer.lisp b/test/ic3/integer.lisp
index 1ecfb01..9630164 100644
--- a/test/ic3/integer.lisp
+++ b/test/ic3/integer.lisp
@@ -25,6 +25,19 @@
                       :direction :output
                       :element-type 'character
                       :if-exists :supersede)
+    (do-numbers
+        (lambda (a)
+          (flet ((output-base (prefix base)
+                   (format expected "~A~A~%"
+                           (if (< a 0) "-" "")
+                           (positional:positional (abs a) 10))
+                   (format in "~A~A~A~%"
+                           (if (< a 0) "-" "")
+                           prefix
+                           (positional:positional (abs a) base))))
+            (output-base "0b" 2)
+            (output-base "0o" 8)
+            (output-base "0x" 16))))
     (dolist (op *ops*)
       (do-numbers
           (lambda (a)
diff --git a/test/ic3/integer.out.expected b/test/ic3/integer.out.expected
index c14e872..e3c7d41 100644
--- a/test/ic3/integer.out.expected
+++ b/test/ic3/integer.out.expected
@@ -1,3 +1,63 @@
+-170141183460469231731687303715884105728
+-170141183460469231731687303715884105728
+-170141183460469231731687303715884105728
+-170141183460469231731687303715884105727
+-170141183460469231731687303715884105727
+-170141183460469231731687303715884105727
+-9223372036854775808
+-9223372036854775808
+-9223372036854775808
+-9223372036854775807
+-9223372036854775807
+-9223372036854775807
+-2147483648
+-2147483648
+-2147483648
+-2147483647
+-2147483647
+-2147483647
+-32768
+-32768
+-32768
+-32767
+-32767
+-32767
+-128
+-128
+-128
+-127
+-127
+-127
+255
+255
+255
+256
+256
+256
+65535
+65535
+65535
+65536
+65536
+65536
+4294967295
+4294967295
+4294967295
+4294967296
+4294967296
+4294967296
+18446744073709551615
+18446744073709551615
+18446744073709551615
+18446744073709551616
+18446744073709551616
+18446744073709551616
+340282366920938463463374607431768211455
+340282366920938463463374607431768211455
+340282366920938463463374607431768211455
+340282366920938463463374607431768211456
+340282366920938463463374607431768211456
+340282366920938463463374607431768211456
 -340282366920938463463374607431768211456
 -340282366920938463463374607431768211455
 -170141183460469231740910675752738881536