Example #1
0
def test_walk_deep_map():
    w, x, y, z = variables("w, x, y, z")
    sub = Substitution({x: "b", z: y, w: Map().insert(x, z).insert("a", "b")})
    value = sub.walk_deep(w)
    assert value == Map().insert("b", y).insert("a", "b")
Example #2
0
def test_walk_deep():
    w, x, y, z = variables("w, x, y, z")
    sub = Substitution({x: "b", z: y, w: (x, "e", z)})
    value = sub.walk_deep(w)
    assert value == ("b", "e", y)