@@ -143,11 +143,11 @@ def test_unexpected_data(self):
143143 ('{"spam":[}' , 'Expecting value' , 9 ),
144144 ('[42:' , "Expecting ',' delimiter" , 3 ),
145145 ('[42 "spam"' , "Expecting ',' delimiter" , 4 ),
146- ('[42,]' , 'Expecting value' , 4 ),
146+ ('[42,]' , "Illegal trailing comma before end of array" , 3 ),
147147 ('{"spam":[42}' , "Expecting ',' delimiter" , 11 ),
148148 ('["]' , 'Unterminated string starting at' , 1 ),
149149 ('["spam":' , "Expecting ',' delimiter" , 7 ),
150- ('["spam",]' , 'Expecting value' , 8 ),
150+ ('["spam",]' , "Illegal trailing comma before end of array" , 7 ),
151151 ('{:' , 'Expecting property name enclosed in double quotes' , 1 ),
152152 ('{,' , 'Expecting property name enclosed in double quotes' , 1 ),
153153 ('{42' , 'Expecting property name enclosed in double quotes' , 1 ),
@@ -159,7 +159,9 @@ def test_unexpected_data(self):
159159 ('[{"spam":]' , 'Expecting value' , 9 ),
160160 ('{"spam":42 "ham"' , "Expecting ',' delimiter" , 11 ),
161161 ('[{"spam":42]' , "Expecting ',' delimiter" , 11 ),
162- ('{"spam":42,}' , 'Expecting property name enclosed in double quotes' , 11 ),
162+ ('{"spam":42,}' , "Illegal trailing comma before end of object" , 10 ),
163+ ('{"spam":42 , }' , "Illegal trailing comma before end of object" , 11 ),
164+ ('[123 , ]' , "Illegal trailing comma before end of array" , 6 ),
163165 ]
164166 for data , msg , idx in test_cases :
165167 with self .assertRaises (self .JSONDecodeError ) as cm :
0 commit comments