From 5fa6d7be25374af1d9d023fe2db5ca6c3ba139fd Mon Sep 17 00:00:00 2001 From: Jason Moiron Date: Tue, 6 Dec 2011 05:46:17 -0500 Subject: [PATCH] add a test to check for the sign bit bug in ujson 1.9 --- python/tests.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/tests.py b/python/tests.py index 074589e..f89411c 100644 --- a/python/tests.py +++ b/python/tests.py @@ -587,6 +587,12 @@ class UltraJSONTests(TestCase): pass else: assert False, "expected OverflowError" + + def test_decodeNumberWith32bitSignBit(self): + """Test that numbers that fit within 32 bits but would have the + sign bit set (2**31 < x < 2**32) are decoded properly.""" + doc = '{"id": 3590016419}' + self.assertEqual(ujson.decode(doc)['id'], 3590016419) """ def test_decodeNumericIntFrcOverflow(self):