summaryrefslogtreecommitdiff
path: root/simplejson/tests/test_unicode.py
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2013-05-07 16:38:34 -0700
committerBob Ippolito <bob@redivi.com>2013-05-07 23:02:33 -0700
commit35816bfe2d0ddeb5ddcc68239683cbb35b7e3ff2 (patch)
treefb0698c12a52678392b8ad1a0393f5186138899a /simplejson/tests/test_unicode.py
parentfc7b04d6bb1bfc0ffdddbd7d53ffd56f4142ea34 (diff)
downloadsimplejson-baserock/morph.tar.gz
pass-through in decoder for lone surrogates #62v3.3.0surrogate-62baserock/morph
Diffstat (limited to 'simplejson/tests/test_unicode.py')
-rw-r--r--simplejson/tests/test_unicode.py13
1 files changed, 1 insertions, 12 deletions
diff --git a/simplejson/tests/test_unicode.py b/simplejson/tests/test_unicode.py
index f240176..f04cc5c 100644
--- a/simplejson/tests/test_unicode.py
+++ b/simplejson/tests/test_unicode.py
@@ -123,26 +123,15 @@ class TestUnicode(TestCase):
self.assertRaises(json.JSONDecodeError, json.loads, '"\\u1x34"')
self.assertRaises(json.JSONDecodeError, json.loads, '"\\ux234"')
if sys.maxunicode > 65535:
- # unpaired low surrogate
- self.assertRaises(json.JSONDecodeError, json.loads, '"\\udc00"')
- self.assertRaises(json.JSONDecodeError, json.loads, '"\\udcff"')
- # unpaired high surrogate
- self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800"')
- self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800x"')
- self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800xx"')
- self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800xxxxxx"')
+ # invalid escape sequence for low surrogate
self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800\\u"')
self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800\\u0"')
self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800\\u00"')
self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800\\u000"')
- # invalid escape sequence for low surrogate
self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800\\u000x"')
self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800\\u00x0"')
self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800\\u0x00"')
self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800\\ux000"')
- # invalid value for low surrogate
- self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800\\u0000"')
- self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800\\ufc00"')
def test_ensure_ascii_still_works(self):
# in the ascii range, ensure that everything is the same