Lines Matching refs:check_expr

29     def check_expr(self, s):  member in RoundtripLegalSyntaxTestCase
64 self.check_expr("foo(1)")
65 self.check_expr("{1:1}")
66 self.check_expr("{1:1, 2:2, 3:3}")
67 self.check_expr("{1:1, 2:2, 3:3,}")
68 self.check_expr("{1}")
69 self.check_expr("{1, 2, 3}")
70 self.check_expr("{1, 2, 3,}")
71 self.check_expr("[]")
72 self.check_expr("[1]")
73 self.check_expr("[1, 2, 3]")
74 self.check_expr("[1, 2, 3,]")
75 self.check_expr("()")
76 self.check_expr("(1,)")
77 self.check_expr("(1, 2, 3)")
78 self.check_expr("(1, 2, 3,)")
79 self.check_expr("[x**3 for x in range(20)]")
80 self.check_expr("[x**3 for x in range(20) if x % 3]")
81 self.check_expr("[x**3 for x in range(20) if x % 2 if x % 3]")
82 self.check_expr("[x+y for x in range(30) for y in range(20) if x % 2 if y % 3]")
84 self.check_expr("list(x**3 for x in range(20))")
85 self.check_expr("list(x**3 for x in range(20) if x % 3)")
86 self.check_expr("list(x**3 for x in range(20) if x % 2 if x % 3)")
87 self.check_expr("list(x+y for x in range(30) for y in range(20) if x % 2 if y % 3)")
88 self.check_expr("{x**3 for x in range(30)}")
89 self.check_expr("{x**3 for x in range(30) if x % 3}")
90 self.check_expr("{x**3 for x in range(30) if x % 2 if x % 3}")
91 self.check_expr("{x+y for x in range(30) for y in range(20) if x % 2 if y % 3}")
92 self.check_expr("{x**3: y**2 for x, y in zip(range(30), range(30))}")
93 self.check_expr("{x**3: y**2 for x, y in zip(range(30), range(30)) if x % 3}")
94 self.check_expr("{x**3: y**2 for x, y in zip(range(30), range(30)) if x % 3 if y % 3}")
95 self.check_expr("{x:y for x in range(30) for y in range(20) if x % 2 if y % 3}")
96 self.check_expr("foo(*args)")
97 self.check_expr("foo(*args, **kw)")
98 self.check_expr("foo(**kw)")
99 self.check_expr("foo(key=value)")
100 self.check_expr("foo(key=value, *args)")
101 self.check_expr("foo(key=value, *args, **kw)")
102 self.check_expr("foo(key=value, **kw)")
103 self.check_expr("foo(a, b, c, *args)")
104 self.check_expr("foo(a, b, c, *args, **kw)")
105 self.check_expr("foo(a, b, c, **kw)")
106 self.check_expr("foo(a, *args, keyword=23)")
107 self.check_expr("foo + bar")
108 self.check_expr("foo - bar")
109 self.check_expr("foo * bar")
110 self.check_expr("foo / bar")
111 self.check_expr("foo // bar")
112 self.check_expr("lambda: 0")
113 self.check_expr("lambda x: 0")
114 self.check_expr("lambda *y: 0")
115 self.check_expr("lambda *y, **z: 0")
116 self.check_expr("lambda **z: 0")
117 self.check_expr("lambda x, y: 0")
118 self.check_expr("lambda foo=bar: 0")
119 self.check_expr("lambda foo=bar, spaz=nifty+spit: 0")
120 self.check_expr("lambda foo=bar, **z: 0")
121 self.check_expr("lambda foo=bar, blaz=blat+2, **z: 0")
122 self.check_expr("lambda foo=bar, blaz=blat+2, *y, **z: 0")
123 self.check_expr("lambda x, *y, **z: 0")
124 self.check_expr("lambda x: 5 if x else 2")
125 self.check_expr("(x for x in range(10))")
126 self.check_expr("foo(x for x in range(10))")