Skip to content

Commit 6839aa8

Browse files
[3.14] improve json test coverage (GH-154123) (GH-154135)
Add test that covers the except block on line 106 of decoder.py (cherry picked from commit ee1e48e) Co-authored-by: David <slavicek.david29@gmail.com>
1 parent 4029242 commit 6839aa8

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
@@ -124,6 +124,10 @@ def test_negative_index(self):
124124
d = self.json.JSONDecoder()
125125
self.assertRaises(ValueError, d.raw_decode, 'a'*42, -50000)
126126

127+
def test_unterminated_string(self):
128+
d = self.json.JSONDecoder()
129+
self.assertRaises(self.JSONDecodeError, d.raw_decode, '"\\')
130+
127131
def test_limit_int(self):
128132
maxdigits = 5000
129133
with support.adjust_int_max_str_digits(maxdigits):

0 commit comments

Comments
 (0)