from pytracify import run 


def test_var_scope_write_local ()->None :
    code ="""
x = 10

def f():
    x = 20

f()

return x
"""
    assert run (code ).result .value ==10 


def test_var_scope_read_global ()->None :
    code ="""
x = 10

def f():
    return x + 1

return f()
"""
    assert run (code ).result .value ==11 
