datalog: parser rejection tests for invalid relation names (233/233)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 56s

This commit is contained in:
2026-05-08 14:16:31 +00:00
parent 0985dc6386
commit 21c541bd1b
3 changed files with 16 additions and 6 deletions

View File

@@ -1,11 +1,11 @@
{
"lang": "datalog",
"total_passed": 231,
"total_passed": 233,
"total_failed": 0,
"total": 231,
"total": 233,
"suites": [
{"name":"tokenize","passed":26,"failed":0,"total":26},
{"name":"parse","passed":18,"failed":0,"total":18},
{"name":"parse","passed":20,"failed":0,"total":20},
{"name":"unify","passed":28,"failed":0,"total":28},
{"name":"eval","passed":32,"failed":0,"total":32},
{"name":"builtins","passed":20,"failed":0,"total":20},
@@ -16,5 +16,5 @@
{"name":"magic","passed":28,"failed":0,"total":28},
{"name":"demo","passed":21,"failed":0,"total":21}
],
"generated": "2026-05-08T14:12:22+00:00"
"generated": "2026-05-08T14:16:19+00:00"
}

View File

@@ -1,11 +1,11 @@
# datalog scoreboard
**231 / 231 passing** (0 failure(s)).
**233 / 233 passing** (0 failure(s)).
| Suite | Passed | Total | Status |
|-------|--------|-------|--------|
| tokenize | 26 | 26 | ok |
| parse | 18 | 18 | ok |
| parse | 20 | 20 | ok |
| unify | 28 | 28 | ok |
| eval | 32 | 32 | ok |
| builtins | 20 | 20 | ok |

View File

@@ -126,6 +126,16 @@
"underscore var"
(dl-parse "p(X) :- q(X, _).")
(list {:body (list (list (quote q) (quote X) (quote _))) :head (list (quote p) (quote X))}))
(dl-pt-test!
"number as relation name raises"
(dl-pt-throws? (fn () (dl-parse "1(X) :- p(X).")))
true)
(dl-pt-test!
"var as relation name raises"
(dl-pt-throws? (fn () (dl-parse "P(X).")))
true)
(dl-pt-test!
"missing dot raises"
(dl-pt-throws? (fn () (dl-parse "p(a)")))