Test that date() refuses a layout naming no date field, and bench the personnummer by name

This commit is contained in:
2026-09-18 18:39:04 +02:00
parent 0c6ab0937a
commit 86eb55d564
2 changed files with 7 additions and 6 deletions
+1
View File
@@ -310,6 +310,7 @@ func TestBuiltinDateArgs(t *testing.T) {
`"{time(15:04)}"`: "'15:04'",
`"{time('2006-01-02 15:04')}"`: "date(",
`"{time('x')}"`: "text",
`"{date(1990-01-01,1990-12-31,'15:04')}"`: "time('15:04')",
} {
_, err := compile(parse(t, tmpl))
if err == nil || !strings.Contains(err.Error(), want) {