summaryrefslogtreecommitdiffstats
path: root/Lib/json/tests/test_decode.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/json/tests/test_decode.py')
-rw-r--r--Lib/json/tests/test_decode.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/json/tests/test_decode.py b/Lib/json/tests/test_decode.py
index aa8bbe9..478a16b 100644
--- a/Lib/json/tests/test_decode.py
+++ b/Lib/json/tests/test_decode.py
@@ -45,6 +45,15 @@ class TestDecode(object):
object_hook=lambda x: None),
OrderedDict(p))
+ def test_extra_data(self):
+ s = '[1, 2, 3]5'
+ msg = 'Extra data'
+ self.assertRaisesRegexp(ValueError, msg, self.loads, s)
+
+ def test_invalid_escape(self):
+ s = '["abc\\y"]'
+ msg = 'escape'
+ self.assertRaisesRegexp(ValueError, msg, self.loads, s)
class TestPyDecode(TestDecode, PyTest): pass
class TestCDecode(TestDecode, CTest): pass