示例#1
0
def test_gen_random_tree_pode_gerar_arvores_validas():
    tree = gen_random_tree(range(1,5))
    execute(tree)
示例#2
0
def test_funcao_somente_com_var_retorna_var():
    ftree = ['a']
    kwargs = {'a': 1}
    assert execute(ftree, kwargs) == 1
示例#3
0
def test_funcao_vazia_retorna_none():
    ftree = []
    assert execute(ftree) == None
示例#4
0
def test_mult_sum():
    ftree = ['+', 1, 2, 3]
    assert execute(ftree) == 6
示例#5
0
def test_var():
    ftree = ['+', 'a', 2]
    kwargs = {'a': 3}
    assert execute(ftree, kwargs) == 5
示例#6
0
def test_sum_profundidade_2():
    ftree = ['+', ['+', 2,3], ['-', 5, ['*', 2, 3]]]
    assert execute(ftree) == 4
示例#7
0
def test_sum_profundidade_1():
    ftree = ['+', ['+', 2,3], 2]
    assert execute(ftree) == 7
示例#8
0
def test_funcao_sum():
    ftree = ['+', 1, 2]
    assert execute(ftree) == 3
示例#9
0
def test_escalar_simples():
    ftree = [1]
    assert execute(ftree) == 1