From dbddb0845a125655b17527502f3bcc4f75c549cd Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Mon, 28 Sep 2026 03:06:46 +0200 Subject: [PATCH] Name the compiled-flag map and fail on its walk --- node_test.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/node_test.go b/node_test.go index f939618..83f1634 100644 --- a/node_test.go +++ b/node_test.go @@ -90,17 +90,19 @@ func TestEveryFormatCompilesAtLink(t *testing.T) { if err != nil { t.Fatal(err) } - opsBy := func() map[string]bool { + compiledByPath := func() map[string]bool { compiled := map[string]bool{} - _ = eachNode(n, "t", func(path string, m node) error { + if err := eachNode(n, "t", func(path string, m node) error { if tm, ok := m.(*template); ok { compiled[path+" "+tm.format] = tm.ops != nil } return nil - }) + }); err != nil { + t.Fatal(err) + } return compiled } - for format, has := range opsBy() { + for format, has := range compiledByPath() { if has { t.Errorf("%s compiled before link", format) } @@ -108,7 +110,7 @@ func TestEveryFormatCompilesAtLink(t *testing.T) { if err := bindInline(n, "t", map[string]node{"w": w}, func(nodeScope) error { return nil }); err != nil { t.Fatal(err) } - for format, has := range opsBy() { + for format, has := range compiledByPath() { if !has { t.Errorf("%s not compiled at link", format) }