Tests: the struct cap sits exactly at 1024 and counts embedded structs, and path advice never names a spelling that fails

This commit is contained in:
2026-09-15 17:50:30 +02:00
parent e4ebfdb28d
commit c212c6bef4
2 changed files with 16 additions and 10 deletions
+3
View File
@@ -185,6 +185,9 @@ func TestIsTemplate(t *testing.T) {
` "{/sv_SE.person}"`: "write sv_SE.person",
`{"format":"{/sv_SE.person}"}`: "write sv_SE.person",
"//sv_SE.person": "write sv_SE.person",
"{//sv_SE.person}": "{//sv_SE.person} is the path sv_SE.person written as a template; write sv_SE.person",
"/sv_SE/person": `path "sv_SE/person" contains "/"`,
"{/-}": `path "-" is reserved`,
} {
if _, err := IsTemplate(arg); err == nil || !strings.Contains(err.Error(), want) {
t.Errorf("IsTemplate(%q) = %v; want it rejected naming %s", arg, err, want)