Beispiel #1
0
def test_no_input_transition():
    t = Transition([], [0])
    state = State([4])
    s2 = t.fire(state)
    assert s2.tokens == [5]
Beispiel #2
0
def test_multi_in_out():
    t = Transition([0, 1, 2, 3], [4, 5, 6])
    state = State([1, 2, 3, 4, 0, 1, 2])
    s2 = t.fire(state)
    assert s2.tokens == [0, 1, 2, 3, 1, 2, 3]
Beispiel #3
0
def test_loop():
    t = Transition([0], [0])
    state = State([6])
    s2 = t.fire(state)
    assert s2.tokens == [6]
Beispiel #4
0
def test_in_and_out_transition():
    t = Transition([0], [1])
    state = State([6, 5])
    s2 = t.fire(state)
    assert s2.tokens == [5, 6]
Beispiel #5
0
def test_nothing_transition():
    t = Transition([], [])
    state = State([6])
    s2 = t.fire(state)
    assert s2.tokens == [6]
Beispiel #6
0
def test_no_output_transition():
    t = Transition([0], [])
    state = State([6])
    s2 = t.fire(state)
    assert s2.tokens == [5]