|
226 | 226 | (test (capture-output (test-results))
|
227 | 227 | "3 tests failed (out of 4 total).\n"))
|
228 | 228 |
|
| 229 | +(let () |
| 230 | + (define-judgment-form empty-language |
| 231 | + [----------- "Base" |
| 232 | + (J1 natural 1)]) |
| 233 | + |
| 234 | + (define-judgment-form empty-language |
| 235 | + [----------- "Base" |
| 236 | + (J2 natural 1)] |
| 237 | + |
| 238 | + [(J1 any_1 any_2) |
| 239 | + (J2 any_1 any_3) |
| 240 | + -------------- "Pair" |
| 241 | + (J2 (any_1 any_2) any_3)]) |
| 242 | + |
| 243 | + (test |
| 244 | + (capture-output |
| 245 | + (test-judgment-holds J2 (derivation `(J2 (1 x) 1) "Pair" |
| 246 | + (list |
| 247 | + (derivation `(J1 1 x) "Base" |
| 248 | + (list)) |
| 249 | + (derivation `(J2 1 1) "Base" |
| 250 | + (list)))))) |
| 251 | + (regexp |
| 252 | + (regexp-quote "because the following sub-derivations fail: |
| 253 | + (derivation '(J1 1 x) \"Base\" '()) |
| 254 | + (derivation |
| 255 | + '(J2 (1 x) 1) |
| 256 | + \"Pair\" |
| 257 | + (list |
| 258 | + (derivation '(J1 1 x) \"Base\" '()) |
| 259 | + (derivation '(J2 1 1) \"Base\" '())))"))) |
| 260 | + |
| 261 | + (test |
| 262 | + (capture-output |
| 263 | + (test-judgment-holds J2 (derivation `(J2 (1 1) 2) "Pair" |
| 264 | + (list |
| 265 | + (derivation `(J1 1 1) "Base" |
| 266 | + (list)) |
| 267 | + (derivation `(J2 1 2) "Base" |
| 268 | + (list)))))) |
| 269 | + (regexp |
| 270 | + (regexp-quote "because the following sub-derivations fail: |
| 271 | + (derivation '(J2 1 2) \"Base\" '()) |
| 272 | + (derivation |
| 273 | + '(J2 (1 1) 2) |
| 274 | + \"Pair\" |
| 275 | + (list |
| 276 | + (derivation '(J1 1 1) \"Base\" '()) |
| 277 | + (derivation '(J2 1 2) \"Base\" '())))"))) |
| 278 | + |
| 279 | + (test |
| 280 | + (capture-output |
| 281 | + (test-judgment-holds J2 (derivation `(J2 (2 1) 1) "Pair" |
| 282 | + (list |
| 283 | + (derivation `(J1 2 1) "Base" |
| 284 | + (list)) |
| 285 | + (derivation `(J2 2 1) "Base" |
| 286 | + (list)))))) |
| 287 | + "") |
| 288 | + |
| 289 | + (test (capture-output (test-results)) |
| 290 | + "2 tests failed (out of 3 total).\n")) |
| 291 | + |
229 | 292 | (let ()
|
230 | 293 | (define-judgment-form empty-language
|
231 | 294 | #:mode (broken-swap I I O O)
|
|
0 commit comments