Beispiel #1
0
def test_no_deps():
    sim = Simulation([v('x', '0'), v('y', '2**3')])
    assert sim.deps == {'x': set(), 'y': set()}
Beispiel #2
0
def test_fn_call_arg_creates_dep():
    sim = Simulation([v('x', '0'), v('y', 'max(x, 0)')])
    assert sim.deps == {'x': set(), 'y': {'x'}}
Beispiel #3
0
def test_no_dep_on_t():
    sim = Simulation([v('x', 't')])
    assert sim.deps == {'x': set()}
Beispiel #4
0
def test_lagged_ref_creates_no_dep():
    sim = Simulation([v('x', '0', '0'), v('y', 'x[t-1]')])
    assert sim.deps == {'x': set(), 'y': set()}
Beispiel #5
0
def test_multiple_deps():
    sim = Simulation([v('x', '0'), v('y', '3'), v('z', 'x[t] + y[t]')])
    assert sim.deps == {'x': set(), 'y': set(), 'z': {'x', 'y'}}
Beispiel #6
0
def test_nonindexed_var_ref():
    sim = Simulation([v('x', '0'), v('y', 'x')])
    assert sim.deps == {'x': set(), 'y': {'x'}}