Skip to content

Commit ee1e48e

Browse files
authored
improve json test coverage (GH-154123)
Add test that covers the except block on line 106 of decoder.py
1 parent 1530b38 commit ee1e48e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/test/test_json/test_decode.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ def test_negative_index(self):
149149
d = self.json.JSONDecoder()
150150
self.assertRaises(ValueError, d.raw_decode, 'a'*42, -50000)
151151

152+
def test_unterminated_string(self):
153+
d = self.json.JSONDecoder()
154+
self.assertRaises(self.JSONDecodeError, d.raw_decode, '"\\')
155+
152156
def test_limit_int(self):
153157
maxdigits = 5000
154158
with support.adjust_int_max_str_digits(maxdigits):

0 commit comments

Comments
 (0)