From 72b878719f6fdac8382019cd3be076d24740ef30 Mon Sep 17 00:00:00 2001 From: favonia Date: Mon, 5 Sep 2022 00:01:26 -0500 Subject: [PATCH] test: improve coverage --- internal/config/config_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 4fd7994c..1b052eb1 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -881,6 +881,28 @@ func TestNormalize(t *testing.T) { ) }, }, + "template/error/proxied/ill-formed": { + input: &config.Config{ //nolint:exhaustruct + Provider: map[ipnet.Type]provider.Provider{ + ipnet.IP6: provider.NewCloudflareTrace(), + }, + Domains: map[ipnet.Type][]domain.Domain{ + ipnet.IP6: {domain.FQDN("a.b.c")}, + }, + TTLTemplate: `1`, + ProxiedTemplate: `{{domain 12345}}`, + }, + ok: false, + expected: nil, + prepareMockPP: func(m *mocks.MockPP) { + gomock.InOrder( + m.EXPECT().IsEnabledFor(pp.Info).Return(true), + m.EXPECT().Infof(pp.EmojiEnvVars, "Checking settings . . ."), + m.EXPECT().IncIndent().Return(m), + m.EXPECT().Errorf(pp.EmojiUserError, "Could not execute the template %q: %v", "{{domain 12345}}", gomock.Any()), //nolint:lll + ) + }, + }, } { tc := tc t.Run(name, func(t *testing.T) {