def _test_wild_term():
    w = Symbol('w')
    p = (2 * w)
    s = Symbol('s')
    t = Symbol('t')
    wargs = ({}, ([w], [True]))
    assert (p.matches(Number(1), *wargs) == {w: (Number(1) / 2)})
    assert (p.matches(Number(2), *wargs) == {w: 1})
    assert (p.matches((2 * s), *wargs) == {w: s})
    assert (p.matches((3 * s), *wargs) == {w: ((s * Number(3)) / 2)})
    assert (p.matches((t * s), *wargs) == {w: ((t * s) / 2)})
    assert (p.matches((s ** 2), *wargs) == {w: ((s ** 2) / 2)})
    m = p.matches(((2 * s) + 2), *wargs)
    assert ((m is not None) and (m[w] == ((2 * (s + 1)) / 2)))
    assert (p.matches(((2 * s) + 4), *wargs) == {w: (((s + 2) * 2) / 2)})
    assert (p.matches(((2 * s) + 5), *wargs) == {w: (((2 * s) + Number(5)) / 2)})
    assert (p.matches(((2 * s) + t), *wargs) == {w: (((2 * s) + t) / 2)})
    assert (p.matches(((2 * s) - (2 * t)), *wargs) == {w: (((s - t) * 2) / 2)})
def _test_wild_term():
    w = Symbol('w')
    p = (2 * w)
    s = Symbol('s')
    t = Symbol('t')
    wargs = ({}, ([w], [True]))
    assert (p.matches(Number(1), *wargs) == {w: (Number(1) / 2)})
    assert (p.matches(Number(2), *wargs) == {w: 1})
    assert (p.matches((2 * s), *wargs) == {w: s})
    assert (p.matches((3 * s), *wargs) == {w: ((s * Number(3)) / 2)})
    assert (p.matches((t * s), *wargs) == {w: ((t * s) / 2)})
    assert (p.matches((s ** 2), *wargs) == {w: ((s ** 2) / 2)})
    m = p.matches(((2 * s) + 2), *wargs)
    assert ((m is not None) and (m[w] == ((2 * (s + 1)) / 2)))
    assert (p.matches(((2 * s) + 4), *wargs) == {w: (((s + 2) * 2) / 2)})
    assert (p.matches(((2 * s) + 5), *wargs) == {w: (((2 * s) + Number(5)) / 2)})
    assert (p.matches(((2 * s) + t), *wargs) == {w: (((2 * s) + t) / 2)})
    assert (p.matches(((2 * s) - (2 * t)), *wargs) == {w: (((s - t) * 2) / 2)})