Tests: a repeat iteration renders in no group, a group that names nothing is refused, a group name is local to its category, and one overlap verdict wherever the reads sit

This commit is contained in:
2026-09-15 23:30:46 +02:00
parent 5ed45cc55c
commit f6b8f4fb50
3 changed files with 39 additions and 14 deletions
+2 -1
View File
@@ -108,8 +108,9 @@ func TestFakeTemplateErrors(t *testing.T) {
{`name: {/no.such.path}`, "no entry"},
{`name: {..nope}`, "write {/nope}"},
{`{"format":"x"}`, "is a string"},
{`{/misc.country} {/misc.country.alpha2}`, "renders a level"},
{`{/misc.country} {/misc.country.alpha2}`, "renders a level that {/misc.country.alpha2} reads a path into; name the fields you want instead, or draw them apart with a group"},
{`{"format":"{/misc.country.alpha2} {x}","x":"{/misc.country}"}`, "reads a path into"},
{`{"format":"{/misc.country.alpha2}","group":"g"}`, "nothing can reference"},
} {
_, err := f.FakeTemplate(c.input)
if err == nil || !strings.Contains(err.Error(), c.want) {