36 lines
507 B
Python
36 lines
507 B
Python
from trace_commentor import Commentor
|
|
from test_utils import asserteq_or_print
|
|
|
|
|
|
def test_binop():
|
|
|
|
@Commentor()
|
|
def target():
|
|
1 + 1
|
|
|
|
asserteq_or_print(
|
|
target(), '''
|
|
def target():
|
|
1 + 1
|
|
"""
|
|
2 : 1 + 1
|
|
"""
|
|
''')
|
|
|
|
|
|
def test_binop_cascade():
|
|
|
|
@Commentor()
|
|
def target():
|
|
1 + 1 + 1
|
|
|
|
asserteq_or_print(
|
|
target(), '''
|
|
def target():
|
|
1 + 1 + 1
|
|
"""
|
|
2 : 1 + 1
|
|
3 : 1 + 1 + 1
|
|
"""
|
|
''')
|