trace_commentor/tests/test_expressions.py
2024-04-19 14:54:32 +08:00

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
"""
''')