Skip to content

Commit 7d58658

Browse files
author
Yury Selivanov
committed
Add more tests for statements
1 parent 363605b commit 7d58658

4 files changed

Lines changed: 102 additions & 1 deletion

File tree

test/statements/for1.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
for a, b, c in b: pass
1+
for a, b, c in b:
2+
pass
3+
else:
4+
1/0
5+
26

37

48
for : keyword.control.flow.python, source.python
@@ -7,3 +11,9 @@
711
b: : source.python
812
: source.python
913
pass : keyword.control.flow.python, source.python
14+
else : keyword.control.flow.python, source.python
15+
: : source.python
16+
: source.python
17+
1 : constant.numeric.dec.python, source.python
18+
/ : keyword.operator.python, source.python
19+
0 : constant.numeric.dec.python, source.python

test/statements/if1.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
if (a if b else c):
2+
1
3+
elif b or c and d:
4+
2
5+
else:
6+
3
7+
8+
9+
10+
if : keyword.control.flow.python, source.python
11+
: source.python
12+
( : punctuation.parenthesis.begin.python, source.python
13+
a : source.python
14+
if : keyword.operator.python, source.python
15+
b : source.python
16+
else : keyword.operator.python, source.python
17+
c : source.python
18+
) : punctuation.parenthesis.end.python, source.python
19+
: : source.python
20+
: source.python
21+
1 : constant.numeric.dec.python, source.python
22+
elif : keyword.control.flow.python, source.python
23+
b : source.python
24+
or : keyword.operator.python, source.python
25+
c : source.python
26+
and : keyword.operator.python, source.python
27+
d: : source.python
28+
: source.python
29+
2 : constant.numeric.dec.python, source.python
30+
else : keyword.control.flow.python, source.python
31+
: : source.python
32+
: source.python
33+
3 : constant.numeric.dec.python, source.python

test/statements/try1.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
try:
2+
1/0
3+
except AbcError as ex:
4+
pass
5+
except (ZeroDivisionError, GhiError) as ex:
6+
print(ex)
7+
else:
8+
1
9+
finally:
10+
2
11+
12+
13+
14+
try : keyword.control.flow.python, source.python
15+
: : source.python
16+
: source.python
17+
1 : constant.numeric.dec.python, source.python
18+
/ : keyword.operator.python, source.python
19+
0 : constant.numeric.dec.python, source.python
20+
except : keyword.control.flow.python, source.python
21+
AbcError : source.python
22+
as : keyword.control.flow.python, source.python
23+
ex: : source.python
24+
: source.python
25+
pass : keyword.control.flow.python, source.python
26+
except : keyword.control.flow.python, source.python
27+
: source.python
28+
( : punctuation.parenthesis.begin.python, source.python
29+
ZeroDivisionError : source.python, support.type.exception.python
30+
, GhiError : source.python
31+
) : punctuation.parenthesis.end.python, source.python
32+
: source.python
33+
as : keyword.control.flow.python, source.python
34+
ex: : source.python
35+
: source.python
36+
print : meta.function-call.python, source.python, support.function.builtin.python
37+
( : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.arguments.begin.python, source.python
38+
ex : meta.function-call.arguments.python, meta.function-call.python, source.python
39+
) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python
40+
else : keyword.control.flow.python, source.python
41+
: : source.python
42+
: source.python
43+
1 : constant.numeric.dec.python, source.python
44+
finally : keyword.control.flow.python, source.python
45+
: : source.python
46+
: source.python
47+
2 : constant.numeric.dec.python, source.python

test/statements/while1.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
while 1:
2+
pass
3+
4+
5+
6+
while : keyword.control.flow.python, source.python
7+
: source.python
8+
1 : constant.numeric.dec.python, source.python
9+
: : source.python
10+
: source.python
11+
pass : keyword.control.flow.python, source.python

0 commit comments

Comments
 (0)