Skip to content

Commit

Permalink
failing test for #106
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed Sep 29, 2014
1 parent 77437f0 commit ccc8a2b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions simplejson/tests/test_dump.py
Expand Up @@ -119,3 +119,12 @@ def test_accumulator(self):
# the C API uses an accumulator that collects after 100,000 appends
lst = [0] * 100000
self.assertEqual(json.loads(json.dumps(lst)), lst)

def test_sort_keys(self):
# https://github.com/simplejson/simplejson/issues/106
for num_keys in range(2, 32):
p = dict((str(x), x) for x in range(num_keys))
sio = StringIO()
json.dump(p, sio, sort_keys=True)
self.assertEqual(sio.getvalue(), json.dumps(p, sort_keys=True))
self.assertEqual(json.loads(sio.getvalue()), p)

0 comments on commit ccc8a2b

Please sign in to comment.