summaryrefslogtreecommitdiffstats
path: root/Lib/json/tests/test_decode.py
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2009-03-17 23:19:00 (GMT)
committerBob Ippolito <bob@redivi.com>2009-03-17 23:19:00 (GMT)
commitd914e3f8619df604ca6fa852fd210043b94f16e1 (patch)
tree99352cdd395da08a735041039f7f336a92485f8d /Lib/json/tests/test_decode.py
parent277859d5910782cc31bb27f2472893b8382ad391 (diff)
downloadcpython-d914e3f8619df604ca6fa852fd210043b94f16e1.zip
cpython-d914e3f8619df604ca6fa852fd210043b94f16e1.tar.gz
cpython-d914e3f8619df604ca6fa852fd210043b94f16e1.tar.bz2
merge json library with simplejson 2.0.9 (issue 4136)
Diffstat (limited to 'Lib/json/tests/test_decode.py')
-rw-r--r--Lib/json/tests/test_decode.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/json/tests/test_decode.py b/Lib/json/tests/test_decode.py
index 609f622..484cc94 100644
--- a/Lib/json/tests/test_decode.py
+++ b/Lib/json/tests/test_decode.py
@@ -13,3 +13,10 @@ class TestDecode(TestCase):
rval = json.loads('1', parse_int=float)
self.assert_(isinstance(rval, float))
self.assertEquals(rval, 1.0)
+
+ def test_decoder_optimizations(self):
+ # Several optimizations were made that skip over calls to
+ # the whitespace regex, so this test is designed to try and
+ # exercise the uncommon cases. The array cases are already covered.
+ rval = json.loads('{ "key" : "value" , "k":"v" }')
+ self.assertEquals(rval, {"key":"value", "k":"v"})