summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_parser.py')
-rw-r--r--Lib/test/test_parser.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index 2112821..18f16e3 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -313,7 +313,12 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
"except Exception as e:\n"
" raise ValueError from e\n")
+ def test_list_displays(self):
+ self.check_expr('[]')
+ self.check_expr('[*{2}, 3, *[4]]')
+
def test_set_displays(self):
+ self.check_expr('{*{2}, 3, *[4]}')
self.check_expr('{2}')
self.check_expr('{2,}')
self.check_expr('{2, 3}')
@@ -325,6 +330,13 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
self.check_expr('{a:b,}')
self.check_expr('{a:b, c:d}')
self.check_expr('{a:b, c:d,}')
+ self.check_expr('{**{}}')
+ self.check_expr('{**{}, 3:4, **{5:6, 7:8}}')
+
+ def test_argument_unpacking(self):
+ self.check_expr('f(a, *b, *c, *d)')
+ self.check_expr('f(**a, **b)')
+ self.check_expr('f(2, *a, *b, **b, **c, **d)')
def test_set_comprehensions(self):
self.check_expr('{x for x in seq}')