summaryrefslogtreecommitdiff
path: root/simplejson/tests/test_unicode.py
diff options
context:
space:
mode:
Diffstat (limited to 'simplejson/tests/test_unicode.py')
-rw-r--r--simplejson/tests/test_unicode.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/simplejson/tests/test_unicode.py b/simplejson/tests/test_unicode.py
index bade96c..f240176 100644
--- a/simplejson/tests/test_unicode.py
+++ b/simplejson/tests/test_unicode.py
@@ -142,4 +142,15 @@ class TestUnicode(TestCase):
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"') \ No newline at end of file
+ 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
+ for c in map(unichr, range(0, 127)):
+ self.assertEqual(
+ json.dumps(c, ensure_ascii=False),
+ json.dumps(c))
+ snowman = u'\N{SNOWMAN}'
+ self.assertEqual(
+ json.dumps(c, ensure_ascii=False),
+ '"' + c + '"')