summaryrefslogtreecommitdiff
path: root/tests/basics/int_64_basics.py
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2025-08-15 08:47:39 -0500
committerDamien George <damien@micropython.org>2025-08-28 11:31:03 +1000
commit1671977ca4be609679db36abc5594f1d76a71e23 (patch)
tree4198bdda9dfbfa15fe34607729f419f5e0ad51da /tests/basics/int_64_basics.py
parentf4f7fbf3dc8164ead907cb418773eef9bbba5644 (diff)
py/parsenum: Fix parsing LLONG_MIN in longlong configuration.
Re-organize `mp_parse_num_integer()` (for longlong) slightly so that the most negative 64-bit integer can be parsed. Fixes issue #17932. Signed-off-by: Jeff Epler <jepler@gmail.com>
Diffstat (limited to 'tests/basics/int_64_basics.py')
-rw-r--r--tests/basics/int_64_basics.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/basics/int_64_basics.py b/tests/basics/int_64_basics.py
index 2a161dac0..ef7679331 100644
--- a/tests/basics/int_64_basics.py
+++ b/tests/basics/int_64_basics.py
@@ -151,3 +151,11 @@ try:
print((1 << 48) << -6)
except ValueError as e:
print(e)
+
+# Test that the most extreme 64 bit integer values all parse with int()
+print(int("-9223372036854775807"))
+print(int("-9223372036854775808"))
+print(int("9223372036854775807"))
+
+# Test that the most negative 64 bit integer can be formed via arithmetic
+print(-9223372036854775807-1)