From 2bbf16764ef8cf763a9e1b533ddf971f3a27f379 Mon Sep 17 00:00:00 2001 From: Sander Kersten Date: Sun, 28 Sep 2014 15:41:05 +0200 Subject: [PATCH] Added test for parsing nested tuples and lists in for-statements --- mypy/test/data/parse.test | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/mypy/test/data/parse.test b/mypy/test/data/parse.test index 783a6de71efc..efaf296ad25d 100644 --- a/mypy/test/data/parse.test +++ b/mypy/test/data/parse.test @@ -831,8 +831,10 @@ MypyFile:1( [case testForStatement] for x in y: pass -for x, y in z: +for x, (y, w) in z: 1 +for [x, (y, w)] in z: + 1 [out] MypyFile:1( ForStmt:1( @@ -842,10 +844,24 @@ MypyFile:1( PassStmt:2())) ForStmt:3( NameExpr(x) - NameExpr(y) + ParenExpr:3( + TupleExpr:3( + NameExpr(y) + NameExpr(w))) NameExpr(z) Block:3( ExpressionStmt:4( + IntExpr(1)))) + ForStmt:5( + ListExpr:5( + NameExpr(x) + ParenExpr:5( + TupleExpr:5( + NameExpr(y) + NameExpr(w)))) + NameExpr(z) + Block:5( + ExpressionStmt:6( IntExpr(1))))) [case testGlobalDecl]