@@ -220,6 +220,74 @@ def test_list_more():
220220 }
221221 ])
222222
223+ def test_list_star_one ():
224+ "[*a]"
225+ parse_simple ([
226+ ('LEFT_SQUARE_BRACKET' , '[' , [], []),
227+ ('STAR' , '*' , [], []),
228+ ('NAME' , 'a' ),
229+ ('RIGHT_SQUARE_BRACKET' , ']' , [], []),
230+ ], [
231+ {
232+ "type" : "list" ,
233+ "first_formatting" : [],
234+ "second_formatting" : [],
235+ "third_formatting" : [],
236+ "fourth_formatting" : [],
237+ "value" : [
238+ {
239+ "formatting" : [],
240+ "type" : "star_expression" ,
241+ "value" : {
242+ "type" : "name" ,
243+ "value" : "a" ,
244+ }
245+ }
246+ ],
247+ }
248+ ])
249+
250+ def test_list_star_more ():
251+ "[*a, 'foo']"
252+ parse_simple ([
253+ ('LEFT_SQUARE_BRACKET' , '[' , [], []),
254+ ('STAR' , '*' , [], []),
255+ ('NAME' , 'a' ),
256+ ('COMMA' , ',' , [], [('SPACE' , ' ' )]),
257+ ('STRING' , "'foo'" ),
258+ ('RIGHT_SQUARE_BRACKET' , ']' , [], []),
259+ ], [
260+ {
261+ "type" : "list" ,
262+ "first_formatting" : [],
263+ "second_formatting" : [],
264+ "third_formatting" : [],
265+ "fourth_formatting" : [],
266+ "value" : [
267+ {
268+ "type" : "star_expression" ,
269+ "formatting" : [],
270+ "value" : {
271+ "type" : "name" ,
272+ "value" : "a" ,
273+ }
274+ },
275+ {
276+ "first_formatting" : [],
277+ "second_formatting" : [{"type" : "space" , "value" : " " }],
278+ "type" : "comma" ,
279+ },
280+ {
281+ "first_formatting" : [],
282+ "second_formatting" : [],
283+ "type" : "string" ,
284+ "value" : "'foo'" ,
285+ }
286+ ],
287+ }
288+ ])
289+
290+
223291
224292def test_dict_empty ():
225293 "{ }"
@@ -301,6 +369,7 @@ def test_dict_one_double_star():
301369)
302370
303371
372+
304373def test_dict_more_colon ():
305374 "{a: b, b: c, c: d}"
306375 parse_simple ([
0 commit comments