From 2e4bc0ff1c9e59121e715e489a6fc102ada93e15 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 2 Aug 2021 18:23:55 +0100 Subject: Use custom integer check to handle large ints larger than 32 bits --- tests/jq_tests.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/jq_tests.py b/tests/jq_tests.py index b5bbbd1..4eab9f7 100644 --- a/tests/jq_tests.py +++ b/tests/jq_tests.py @@ -165,6 +165,15 @@ def test_unicode_strings_can_be_used_as_programs(): ) +def test_returned_integers_larger_than_32_bits_have_int_type(): + program = jq.compile("pow(.; 33)") + + result = program.input(2).first() + + assert_equal(2 ** 33, result) + assert_equal(int, type(result)) + + def test_compiling_with_args_should_set_predefined_variables(): assert_equal( 123, -- cgit v1.2.3