-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli-tests.bats
executable file
·194 lines (161 loc) · 5.65 KB
/
cli-tests.bats
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#!/usr/bin/env bats
# vi: ft=bash
# test runner is https://github.com/bats-core/bats-core
# tags:
# expand: uses expansion
# symbolic: requires cvc5
# target: uses --target option
# bats test_tags=symbolic,buckets
@test "full symbolic buckets" {
result="$(./color-unfolder buckets#4#3#5 | wc -l)"
[ "$result" -eq 442 ]
}
# bats test_tags=expand,buckets
@test "full expanded buckets" {
result="$(./color-unfolder buckets#4#3#5 --expand | wc -l)"
[ "$result" -eq 442 ]
}
# bats test_tags=symbolic,target,buckets
@test "reachable goal symbolic buckets" {
./color-unfolder buckets#4#3#5 --output=none --target=goal
}
# bats test_tags=expand,target,buckets
@test "reachable goal expanded buckets" {
./color-unfolder buckets#4#3#5 --output=none --target=goal --expand
}
# bats test_tags=symbolic,target,buckets
@test "unreachable goal symbolic buckets" {
run ./color-unfolder buckets#4#3#6 --output=none --target=goal
[ "$status" -ne 0 ]
}
# bats test_tags=expand,target,buckets
@test "unreachable goal expanded buckets" {
run ./color-unfolder buckets#4#3#6 --output=none --target=goal --expand
[ "$status" -ne 0 ]
}
# bats test_tags=symbolic
@test "full symbolic parallel amnesia" {
result="$(./color-unfolder parallel-amnesia#3 | wc -l)"
[ "$result" -eq 25 ]
}
# bats test_tags=expand
@test "full expanded parallel amnesia" {
result="$(./color-unfolder parallel-amnesia#3 --expand-with=0..5 | wc -l)"
[ "$result" -eq 17285 ]
}
# bats test_tags=expand
@test "full expanded parallel amnesia no jit expand" {
result="$(./color-unfolder parallel-amnesia#3 --expand-with=0..5 --no-jit-expand | wc -l)"
[ "$result" -eq 17285 ]
}
# bats test_tags=symbolic,diamond
@test "full symbolic independent diamond 3 places" {
result="$(./color-unfolder independent-diamond#3 | wc -l)"
[ "$result" -eq 17 ]
}
# bats test_tags=symbolic,diamond
@test "full symbolic independent diamond 4 places" {
result="$(./color-unfolder independent-diamond#4 | wc -l)"
[ "$result" -eq 20 ]
}
# bats test_tags=symbolic,diamond
@test "full symbolic independent diamond 100 places" {
result="$(./color-unfolder independent-diamond#100 | wc -l)"
[ "$result" -eq 308 ]
}
# bats test_tags=expand,diamond
@test "full expanded independent diamond 3 places 3 colors" {
result="$(./color-unfolder independent-diamond#3 --expand-with=1..3 | wc -l)"
[ "$result" -eq 329 ]
}
# bats test_tags=expand,diamond
@test "full expanded independent diamond 3 places 4 colors" {
result="$(./color-unfolder independent-diamond#3 --expand-with=1..4 | wc -l)"
[ "$result" -eq 773 ]
}
# bats test_tags=expand,diamond
@test "full expanded independent diamond 4 places 3 colors" {
result="$(./color-unfolder independent-diamond#4 --expand-with=1..3 | wc -l)"
[ "$result" -eq 1220 ]
}
# bats test_tags=symbolic,gcd
@test "full symbolic gcd(12, 9) size" {
result=$(./color-unfolder gcd#12#9 | wc -l)
[ "$result" -eq 25 ]
}
# bats test_tags=expand,gcd
@test "full expanded gcd(12, 9) size" {
result=$(./color-unfolder gcd#12#9 --expand | wc -l)
[ "$result" -eq 25 ]
}
# bats test_tags=expand,gcd
@test "full expanded gcd(12, 9) output 3" {
./color-unfolder gcd#12#9 --expand | grep p3#3
}
# bats test_tags=expand,gcd
@test "full expanded gcd(12, 9) outputs nothing except 3" {
run bash -c './color-unfolder gcd#12#9 --expand | grep "(p3#[^3])"'
[ "$status" -ne 0 ]
}
# bats test_tags=symbolic,gcd
@test "full symbolic isqrt(100) size" {
result=$(./color-unfolder isqrt#100 | wc -l)
[ "$result" -eq 101 ]
}
# bats test_tags=expand,gcd
@test "full expanded isqrt(100) size" {
result=$(./color-unfolder isqrt#100 --expand | wc -l)
[ "$result" -eq 101 ]
}
# bats test_tags=symbolic,target,hobbits
@test "reachable symbolic hobbitsAndOrcs#3#2#2" {
./color-unfolder hobbitsAndOrcs#3#2#2 --output=none --target=goal
}
# bats test_tags=expand,target,hobbits
@test "reachable expanded hobbitsAndOrcs#3#2#2" {
./color-unfolder hobbitsAndOrcs#3#2#2 --output=none --target=goal --expand
}
# bats test_tags=symbolic,target,hobbits
@test "unreachable symbolic hobbitsAndOrcs#4#2#2" {
run ./color-unfolder hobbitsAndOrcs#4#2#2 --output=none --target=goal
[ "$status" -ne 0 ]
}
# bats test_tags=expand,target,hobbits
@test "unreachable expanded hobbitsAndOrcs#4#2#2" {
run ./color-unfolder hobbitsAndOrcs#4#2#2 --output=none --target=goal --expand
[ "$status" -ne 0 ]
}
# bats test_tags=symbolic,target,hobbits
@test "reachable symbolic hobbitsAndOrcs#3#3#2" {
./color-unfolder hobbitsAndOrcs#3#3#2 --output=none --target=goal
}
# bats test_tags=expand,target,hobbits
@test "reachable expanded hobbitsAndOrcs#3#3#2" {
./color-unfolder hobbitsAndOrcs#3#3#2 --output=none --target=goal --expand
}
# bats test_tags=symbolic,target,hobbits
@test "reachable symbolic hobbitsAndOrcs#4#3#2" {
./color-unfolder hobbitsAndOrcs#4#3#2 --output=none --target=goal
}
# bats test_tags=expand,target,hobbits
@test "reachable expanded hobbitsAndOrcs#4#3#2" {
./color-unfolder hobbitsAndOrcs#4#3#2 --output=none --target=goal --expand
}
# bats test_tags=symbolic,target,hobbits
@test "reachable symbolic hobbitsAndOrcs#5#3#2" {
./color-unfolder hobbitsAndOrcs#5#3#2 --output=none --target=goal
}
# bats test_tags=expand,target,hobbits
@test "reachable expanded hobbitsAndOrcs#5#3#2" {
./color-unfolder hobbitsAndOrcs#5#3#2 --output=none --target=goal --expand
}
# bats test_tags=symbolic,target,hobbits
@test "unreachable symbolic hobbitsAndOrcs#6#3#2" {
run ./color-unfolder hobbitsAndOrcs#6#3#2 --output=none --target=goal
[ "$status" -ne 0 ]
}
# bats test_tags=expand,target,hobbits
@test "unreachable expanded hobbitsAndOrcs#6#3#2" {
run ./color-unfolder hobbitsAndOrcs#6#3#2 --output=none --target=goal --expand
[ "$status" -ne 0 ]
}