-
Notifications
You must be signed in to change notification settings - Fork 0
/
testes_experimentais.py
55 lines (50 loc) · 2.34 KB
/
testes_experimentais.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from questao1 import maquina_questao_1
from questao2 import maquina_questao_2
from questao3 import maquina_questao_3
from questao4 import *
def testes_questao_1():
assert maquina_questao_1([0,0,1,1]) == [1,0,1,1]
assert maquina_questao_1([1,1,1,1,0,1]) == [0,0,0,0,1,1]
assert maquina_questao_1([1,1,1,1,1,1,1]) == [0,0,0,0,0,0,0,1]
assert maquina_questao_1([0]) == [1]
assert maquina_questao_1([1]) == [0,1]
print("Testes da primeira questao passaram com sucesso!")
def testes_questao_2():
assert maquina_questao_2([]) == [1]
assert maquina_questao_2([1]) == [1]
assert maquina_questao_2([1, 1]) == [1]
assert maquina_questao_2([1, 1, 1]) == []
assert maquina_questao_2([1, 1, 1, 1]) == [1]
assert maquina_questao_2([1, 1, 1, 1, 1, 1, 1]) == [1, 1, 1, 1]
print("Testes da segunda questao passaram com sucesso!")
def testes_questao_3():
assert maquina_questao_3([0]) == []
assert maquina_questao_3([1, 0]) == [1]
assert maquina_questao_3([0, 1]) == []
assert maquina_questao_3([1, 0, 1]) == []
assert maquina_questao_3([1, 1, 0, 1, 1]) == []
assert maquina_questao_3([1, 1, 0, 1, 1, 1]) == []
assert maquina_questao_3([1, 1, 1, 1, 1, 0, 1, 1]) == [1, 1, 1]
print("Testes da terceira questao passaram com sucesso!")
def testes_questao_4():
assert maquina_questao4_a(['#']) == True
assert maquina_questao4_a([0, 1, '#', 1, 0]) == True
assert maquina_questao4_a([0, 1, '#', 0, 1]) == False
assert maquina_questao4_a([0, 1, '#', 1, 0, 0]) == False
assert maquina_questao4_b(['a','a','b','b','c','c']) == True
assert maquina_questao4_b(['a','a','b','b','c']) == True
assert maquina_questao4_b(['a','b','b','c']) == False
assert maquina_questao4_b(['a','b','b','c','c','c']) == False
assert maquina_questao4_c(['a','b','c','c']) == True
assert maquina_questao4_c(['a','b', 'b','c','c', 'c']) == True
assert maquina_questao4_c(['a','b','c','c', 'c']) == False
assert maquina_questao4_c(['a', 'a','b','c']) == False
assert maquina_questao4_d([]) == True
assert maquina_questao4_d(['a','b','c']) == True
assert maquina_questao4_d(['a','a','b', 'c']) == False
assert maquina_questao4_d(['a','b','b','c']) == False
print("Testes da quarta questao passaram com sucesso!")
testes_questao_1()
testes_questao_2()
testes_questao_3()
testes_questao_4()