This commit is contained in:
Benjamin Peterson 2015-02-01 18:00:19 -05:00
commit 71cf91cc09
3 changed files with 22 additions and 5 deletions

View file

@ -1,5 +1,6 @@
from collections import OrderedDict
from test.test_json import PyTest, CTest
from test.support import bigaddrspacetest
CASES = [
@ -38,4 +39,10 @@ class TestEncodeBasestringAscii:
class TestPyEncodeBasestringAscii(TestEncodeBasestringAscii, PyTest): pass
class TestCEncodeBasestringAscii(TestEncodeBasestringAscii, CTest): pass
class TestCEncodeBasestringAscii(TestEncodeBasestringAscii, CTest):
@bigaddrspacetest
def test_overflow(self):
s = "\uffff"*((2**32)//6 + 1)
with self.assertRaises(OverflowError):
self.json.encoder.encode_basestring_ascii(s)