This commit is contained in:
Yuyao Huang
2024-04-20 02:01:26 +08:00
parent 245a927382
commit 49651168e3
9 changed files with 136 additions and 16 deletions
+42
View File
@@ -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
''')
+1 -1
View File
@@ -23,7 +23,7 @@ def test_tuple():
def target():
a, b = 1, 2
"""
========
----------
1 : a
2 : b
"""