Exemplo n.º 1
0
def test_insert_loop_token():
    # XXX this test is a bit useless now that there are no specnodes
    lst = []
    #
    tok1 = LoopToken()
    insert_loop_token(lst, tok1)
    assert lst == [tok1]
    #
    tok2 = LoopToken()
    insert_loop_token(lst, tok2)
    assert lst == [tok1, tok2]
    #
    tok3 = LoopToken()
    insert_loop_token(lst, tok3)
    assert lst == [tok1, tok2, tok3]
Exemplo n.º 2
0
def test_insert_loop_token():
    lst = []
    #
    tok1 = LoopToken()
    tok1.specnodes = [NotSpecNode()]
    insert_loop_token(lst, tok1)
    assert lst == [tok1]
    #
    tok2 = LoopToken()
    tok2.specnodes = [ConstantSpecNode(ConstInt(8))]
    insert_loop_token(lst, tok2)
    assert lst == [tok2, tok1]
    #
    tok3 = LoopToken()
    tok3.specnodes = [ConstantSpecNode(ConstInt(-13))]
    insert_loop_token(lst, tok3)
    assert lst == [tok2, tok3, tok1]
Exemplo n.º 3
0
def test_insert_loop_token():
    lst = []
    #
    tok1 = LoopToken()
    tok1.specnodes = [NotSpecNode()]
    insert_loop_token(lst, tok1)
    assert lst == [tok1]
    #
    tok2 = LoopToken()
    tok2.specnodes = [ConstantSpecNode(ConstInt(8))]
    insert_loop_token(lst, tok2)
    assert lst == [tok2, tok1]
    #
    tok3 = LoopToken()
    tok3.specnodes = [ConstantSpecNode(ConstInt(-13))]
    insert_loop_token(lst, tok3)
    assert lst == [tok2, tok3, tok1]