Skip to content

Commit e4df0f8

Browse files
committed
added negative nigNum to test_to_json_large_numers
1 parent 7afeadb commit e4df0f8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pandas/tests/io/json/test_ujson.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -560,14 +560,15 @@ def test_encode_long_conversion(self):
560560
assert output == json.dumps(long_input)
561561
assert long_input == ujson.decode(output)
562562

563-
def test_dumps_ints_larger_than_maxsize(self):
563+
@pytest.mark.parametrize("bigNum", [sys.maxsize + 1, -(sys.maxsize + 1)])
564+
def test_dumps_ints_larger_than_maxsize(self, bigNum):
564565
# GH34395
565-
big_num = sys.maxsize + 1
566-
encoding = ujson.encode(big_num)
566+
bigNum = sys.maxsize + 1
567+
encoding = ujson.encode(bigNum)
567568

568-
assert str(big_num) == encoding
569+
assert str(bigNum) == encoding
569570
# ujson.loads to be fixed in the future
570-
# assert ujson.loads(encoding) == big_num
571+
# assert ujson.loads(encoding) == bigNum
571572

572573
@pytest.mark.parametrize(
573574
"int_exp", ["1337E40", "1.337E40", "1337E+9", "1.337e+40", "1.337E-4"]

0 commit comments

Comments
 (0)