Answer prose round 1: name the parent after .., mark the step down as the one exception to the shared draw, and plainer errors

This commit is contained in:
2026-10-05 00:18:46 +02:00
committed by Lillem4n
parent 406232e8f9
commit ec1dcbf9d3
8 changed files with 26 additions and 22 deletions
+3 -3
View File
@@ -338,7 +338,7 @@ func TestTableStepUpRefusals(t *testing.T) {
"locality[L4]...municipality": "empty segment",
"locality[L4].municipality.name": "..municipality.name",
"locality[L4].name..municipality": "column",
"x..y": "not a table",
"x..y": "only from a table's row",
} {
f := newGenerator(t, writeFiles(t, with(geo(), map[string]string{"x.json": `{"format":"{y}","y":"a"}`})))
if _, err := f.Fake(path); err == nil || !strings.Contains(err.Error(), want) {
@@ -352,8 +352,8 @@ func TestTableStepUpRefusals(t *testing.T) {
t.Errorf("{/%s}: New = %v, want an error mentioning %s", path, err, want)
}
}
if _, err := New(WithoutShippedData(), WithDataPath(writeFiles(t, map[string]string{"s.json": `{"format":"{a..b}","a":{"format":"{b}","b":"x"}}`}))); err == nil || !strings.Contains(err.Error(), "not a table") {
t.Errorf("{a..b} on a field: New = %v, want an error mentioning not a table", err)
if _, err := New(WithoutShippedData(), WithDataPath(writeFiles(t, map[string]string{"s.json": `{"format":"{a..b}","a":{"format":"{b}","b":"x"}}`}))); err == nil || !strings.Contains(err.Error(), "only from a table's row") {
t.Errorf("{a..b} on a field: New = %v, want an error mentioning only from a table's row", err)
}
}