You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
More tests
This commit is contained in:
@@ -7,3 +7,86 @@ if True:
|
||||
b = 1
|
||||
else:
|
||||
d = 2
|
||||
|
||||
|
||||
a = 1
|
||||
|
||||
if a == 1:
|
||||
a = 3
|
||||
elif a == 2:
|
||||
a = 4
|
||||
|
||||
if a == 1:
|
||||
a = 5
|
||||
elif a == 2:
|
||||
a = 6
|
||||
else:
|
||||
a = 7
|
||||
|
||||
if a == 1:
|
||||
a = 8
|
||||
elif a == 7:
|
||||
a = 9
|
||||
elif a == 3:
|
||||
a = 10
|
||||
else:
|
||||
a = 11
|
||||
|
||||
if a == 11:
|
||||
a = 12
|
||||
elif a == 12:
|
||||
a = 13
|
||||
elif a == 13:
|
||||
a = 14
|
||||
|
||||
if a == 1:
|
||||
b = 1
|
||||
else:
|
||||
if a == 2:
|
||||
b = 2
|
||||
else:
|
||||
if a == 3:
|
||||
b = 3
|
||||
else:
|
||||
b = 4
|
||||
|
||||
if a == 1:
|
||||
a = 1
|
||||
else:
|
||||
if a == 2:
|
||||
a = 2
|
||||
else:
|
||||
b = 3
|
||||
if a == 3:
|
||||
b = 4
|
||||
else:
|
||||
b = 5
|
||||
|
||||
if a == 1:
|
||||
b = 1
|
||||
else:
|
||||
b = 2
|
||||
if a == 2:
|
||||
b = 3
|
||||
else:
|
||||
if a == 3:
|
||||
b = 4
|
||||
else:
|
||||
b = 5
|
||||
|
||||
if a == 1:
|
||||
b = 2
|
||||
else:
|
||||
b = 3
|
||||
if a == 2:
|
||||
b = 4
|
||||
else:
|
||||
b = 5
|
||||
if a == 3:
|
||||
b = 6
|
||||
elif a == 4:
|
||||
b = 7
|
||||
elif a == 4:
|
||||
b = 8
|
||||
else:
|
||||
b = 9
|
||||
|
2
test/simple_source/calls/01_fns.py
Normal file
2
test/simple_source/calls/01_fns.py
Normal file
@@ -0,0 +1,2 @@
|
||||
globals()
|
||||
locals()
|
@@ -12,7 +12,4 @@
|
||||
|
||||
[ i for i in (1, 2, 3, 4) ]
|
||||
[ i+1 for i in (1, 2, 3, 4) ]
|
||||
|
||||
# Try next:
|
||||
# [ i * i for i in range(4) ]
|
||||
# [ i * j for i in range(4) for j in range(7) ]
|
||||
[ i * i for i in range(4) ]
|
||||
|
22
test/simple_source/comprehension/05_list_comprehension.py
Normal file
22
test/simple_source/comprehension/05_list_comprehension.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# Tests:
|
||||
|
||||
# Python2:
|
||||
# assert_expr_and ::= assert_expr jmp_false expr
|
||||
# and ::= expr jmp_false expr \e__come_from
|
||||
# expr ::= list_compr
|
||||
# list_iter ::= list_for
|
||||
# list_for ::= expr _for designator list_iter JUMP_BACK
|
||||
# list_iter ::= lc_body
|
||||
# lc_body ::= expr LIST_APPEND
|
||||
|
||||
[b for b in (0,1,2,3)] if __name__ == '__main__' else 5
|
||||
|
||||
# Python2:
|
||||
# list_compr ::= BUILD_LIST_0 list_iter
|
||||
# list_iter ::= list_for
|
||||
# list_for ::= expr _for designator list_iter JUMP_BACK
|
||||
# list_iter ::= list_for
|
||||
# list_for ::= expr _for designator list_iter JUMP_BACK
|
||||
# list_iter ::= lc_body
|
||||
# lc_body ::= expr LIST_APPEND
|
||||
[ i * j for i in range(4) for j in range(7) ]
|
@@ -1,5 +0,0 @@
|
||||
# Tests:
|
||||
# list_compr ::= BUILD_LIST_0 list_iter
|
||||
# list_iter ::= list_for
|
||||
# list_for ::= expr _for designator list_iter JUMP_BACK
|
||||
[b for b in (0,1,2,3)] if True else 5
|
1
test/simple_source/stmts/05_if_assign.py
Normal file
1
test/simple_source/stmts/05_if_assign.py
Normal file
@@ -0,0 +1 @@
|
||||
a = 'True' if __name__ == '__main__' else False
|
13
test/simple_source/stmts/10_del.py
Normal file
13
test/simple_source/stmts/10_del.py
Normal file
@@ -0,0 +1,13 @@
|
||||
a = (1, 2, 3)
|
||||
del a
|
||||
|
||||
b = [4, 5, 6]
|
||||
del b[1]
|
||||
del b[:]
|
||||
|
||||
c = [0,1,2,3,4]
|
||||
del c[:1]
|
||||
del c[2:3]
|
||||
|
||||
d = [0,1,2,3,4,5,6]
|
||||
del d[1:3:2]
|
Reference in New Issue
Block a user