If()
This commit is contained in:
@@ -17,3 +17,45 @@ def test_constant():
|
||||
None : print(x == 2)
|
||||
"""
|
||||
''')
|
||||
|
||||
|
||||
def test():
|
||||
|
||||
@Commentor("<return>")
|
||||
def target():
|
||||
x = 2
|
||||
if x > 3:
|
||||
x = 2 * x
|
||||
y = 1
|
||||
elif x > 2:
|
||||
x = 4 * x
|
||||
y = 2
|
||||
elif x > 3:
|
||||
x = 4 * x
|
||||
y = 3
|
||||
else:
|
||||
x = 8 * x
|
||||
y = 5
|
||||
|
||||
asserteq_or_print(target(), '''
|
||||
def target():
|
||||
x = 2
|
||||
if x > 3: # False
|
||||
x = 2 * x
|
||||
y = 1
|
||||
elif x > 2: # False
|
||||
x = 4 * x
|
||||
y = 2
|
||||
elif x > 3: # False
|
||||
x = 4 * x
|
||||
y = 3
|
||||
else: # True
|
||||
x = 8 * x
|
||||
"""
|
||||
2 : x
|
||||
16 : 8 * x
|
||||
----------
|
||||
16 : x
|
||||
"""
|
||||
y = 5
|
||||
''')
|
||||
|
||||
@@ -23,7 +23,7 @@ def test_tuple():
|
||||
def target():
|
||||
a, b = 1, 2
|
||||
"""
|
||||
========
|
||||
----------
|
||||
1 : a
|
||||
2 : b
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user