summaryrefslogtreecommitdiffstats
path: root/Lib/json/tests/test_pass1.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-11-26 17:22:58 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2012-11-26 17:22:58 (GMT)
commit282d331ec7ed6711738c823fe05878ffca9e3ff8 (patch)
tree7fad783938a1f35e41ccd03d93e88bfda246db33 /Lib/json/tests/test_pass1.py
parent55b4cfb99295d982b0be5cdd6ae9d552798f240f (diff)
downloadcpython-282d331ec7ed6711738c823fe05878ffca9e3ff8.zip
cpython-282d331ec7ed6711738c823fe05878ffca9e3ff8.tar.gz
cpython-282d331ec7ed6711738c823fe05878ffca9e3ff8.tar.bz2
#16559: Add more tests for the json module. Patch by Serhiy Storchaka.
Diffstat (limited to 'Lib/json/tests/test_pass1.py')
-rw-r--r--Lib/json/tests/test_pass1.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/Lib/json/tests/test_pass1.py b/Lib/json/tests/test_pass1.py
index 82d7154..df8259b 100644
--- a/Lib/json/tests/test_pass1.py
+++ b/Lib/json/tests/test_pass1.py
@@ -17,7 +17,7 @@ JSON = r'''
"real": -9876.543210,
"e": 0.123456789e-12,
"E": 1.234567890E+34,
- "": 23456789012E666,
+ "": 23456789012E66,
"zero": 0,
"one": 1,
"space": " ",
@@ -28,6 +28,7 @@ JSON = r'''
"alpha": "abcdefghijklmnopqrstuvwyz",
"ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
"digit": "0123456789",
+ "0123456789": "digit",
"special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
"hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A",
"true": true,
@@ -43,8 +44,7 @@ JSON = r'''
,
-4 , 5 , 6 ,7 ],
- "compact": [1,2,3,4,5,6,7],
+4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7],
"jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}",
"quotes": "&#34; \u0022 %22 0x22 034 &#x22;",
"\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
@@ -55,9 +55,11 @@ JSON = r'''
99.44
,
-1066
-
-
+1066,
+1e1,
+0.1e1,
+1e-1,
+1e00,2e+00,2e-00
,"rosebud"]
'''
@@ -67,12 +69,6 @@ class TestPass1(object):
res = self.loads(JSON)
out = self.dumps(res)
self.assertEqual(res, self.loads(out))
- try:
- self.dumps(res, allow_nan=False)
- except ValueError:
- pass
- else:
- self.fail("23456789012E666 should be out of range")
class TestPyPass1(TestPass1, PyTest): pass