diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2012-11-26 17:24:20 (GMT) |
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2012-11-26 17:24:20 (GMT) |
| commit | 8c523704031ffa5c4b55e2954aac11ee548ab5dc (patch) | |
| tree | db16aa948f842c69023b06cc72dd33572e500461 /Lib/test/json_tests/test_pass1.py | |
| parent | 0b502ff33b107d5e30f8e2176ac88f7a0993c8d0 (diff) | |
| download | cpython-8c523704031ffa5c4b55e2954aac11ee548ab5dc.zip cpython-8c523704031ffa5c4b55e2954aac11ee548ab5dc.tar.gz cpython-8c523704031ffa5c4b55e2954aac11ee548ab5dc.tar.bz2 | |
#16559: Add more tests for the json module. Patch by Serhiy Storchaka.
Diffstat (limited to 'Lib/test/json_tests/test_pass1.py')
| -rw-r--r-- | Lib/test/json_tests/test_pass1.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/Lib/test/json_tests/test_pass1.py b/Lib/test/json_tests/test_pass1.py index 036a2e4..52445f3 100644 --- a/Lib/test/json_tests/test_pass1.py +++ b/Lib/test/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": "" \u0022 %22 0x22 034 "", "\/\\\"\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: 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 |
