port simplejson upgrade from the trunk #4136

json also now works only with unicode strings

Patch by Antoine Pitrou; updated by me
This commit is contained in:
Benjamin Peterson 2009-05-02 12:36:44 +00:00
parent 7255f18556
commit c6b607d4a9
15 changed files with 2011 additions and 959 deletions

View file

@ -32,3 +32,10 @@ class TestDecode(TestCase):
object_pairs_hook = OrderedDict,
object_hook = lambda x: None),
OrderedDict(p))
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"})