-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
114 lines (82 loc) · 2.58 KB
/
tests.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
from weblogic import testshell
from weblogic import parse
# Create your tests here.
# Test Cases
fin = False
while (not fin):
var = input("\n[1] See non-modal sample tests [2] See modal tests [3] Unsolved (Infinite Loop - to be fixed) [4] Parsing [5] Quit. Enter the number as a string, e.g. "1": ")
# Sample Nonmodal Tests
if (var == "1"):
test = ["a", "b"]
testshell(test)
print("Expected: Consistent")
test = ["a", "Na"]
testshell(test)
print("Expected: Not Consistent")
test = ["KKcab", "ANNNbNf", "AKefNc"]
testshell(test)
print("Expected: Not Consistent")
test = ["NKab", "NAab"]
testshell(test)
print("Expected: Consistent")
test = ["Aab", "Na"]
testshell(test)
print("Expected: Consistent")
test = ["Aab", "Na", "Nb"]
testshell(test)
print("Expected: Not Consistent")
test = ['NCKpCpqq']
testshell(test)
print("Expected: Inconsistent")
test = ['CKpCpqq']
testshell(test)
print("Expected: Consistent")
# Sample Modal Tests
elif (var == "2"):
test = ["Ma"]
testshell(test)
print("Expected: Consistent")
test = ["La", "b"]
testshell(test)
print("Expected: Consistent")
test = ["La", "MNa"]
testshell(test)
print("Expected: Not Consistent")
test = ["Ma", "Na"]
testshell(test)
print("Expected: Consistent")
test = ["Mp", "Mq", "Np", "Nq", "LNKpq"]
testshell(test)
print("Expected: Consistent")
test = ["ALpMq", "LNq", "Np"]
testshell(test)
print("Expected: Not Consistent")
test = ['LKaMb', 'ANbNa']
testshell(test)
print("Expected: Consistent")
test = ["LALoLp", "Np"]
testshell(test)
print("Expected: Consistent")
test = ["LAMpLi", "KMpMNLq", "NKaMp"]
testshell(test)
print("Expected: Consistent")
test = ['Mp', 'MNp', 'LANpLp']
testshell(test)
print("Expected: Inconsistent")
test = ['Mp', 'q']
testshell(test)
print("Expected: Consistent")
test = ["NCLCpqCLpLq"]
testshell(test)
print("Expected: Inconsistent")
elif var == "3":
#needs work - infinite loop
test = ['Mp', 'MLq', 'NLCpLq']
testshell(test)
elif var == "4":
print("Parsing")
print('NAMNANpqAMNpLq')
print(parse('NAMNANpqAMNpLq'))
print("Expected: 8")
else:
fin = True