Test that a calc over digits(0) or a repeat of 0 is refused, that an option of the wrong kind names its JSON kind, and that the root scope is the category

This commit is contained in:
2026-10-07 23:58:22 +02:00
committed by Lillem4n
parent 924ba07c1c
commit ba2ae41ffe
6 changed files with 41 additions and 6 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ func TestDatatypeSitsOnlyInAColumn(t *testing.T) {
}
for src, want := range map[string]string{
`{"format":"","n":{"format":"1","datatype":"int"}}`: `datatype takes "string", "integer", "number" or "boolean", got "int"`,
`{"format":"","n":{"format":"1","datatype":1}}`: "datatype must be a string",
`{"format":"","n":{"format":"1","datatype":1}}`: "datatype must be a string, not a number",
} {
if _, err := resolved(t, src); err == nil || !strings.Contains(err.Error(), want) {
t.Errorf("compile(%s) = %v, want an error containing %q", src, err, want)