Skip to content

Commit

Permalink
test: improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
favonia committed Sep 5, 2022
1 parent 79f00b2 commit 72b8787
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 72b8787

Please sign in to comment.