diff options
author | 2022-07-20 10:35:04 -0400 | |
---|---|---|
committer | 2022-07-20 10:35:04 -0400 | |
commit | 513f27b9a95c4eefc2d16b785c1349e9f32a3ce6 (patch) | |
tree | 34e749d0b1d90f433af299d6526bd8ec678e16a2 /plugin/forward/setup_policy_test.go | |
parent | 11059dd855d2644facd3afd0f46a14c70201d1c1 (diff) | |
download | coredns-513f27b9a95c4eefc2d16b785c1349e9f32a3ce6.tar.gz coredns-513f27b9a95c4eefc2d16b785c1349e9f32a3ce6.tar.zst coredns-513f27b9a95c4eefc2d16b785c1349e9f32a3ce6.zip |
plugin/forward: Enable multiple forward declarations (#5127)
* enable multiple declarations of forward plugin
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
Diffstat (limited to 'plugin/forward/setup_policy_test.go')
-rw-r--r-- | plugin/forward/setup_policy_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugin/forward/setup_policy_test.go b/plugin/forward/setup_policy_test.go index 2786f9a7a..13466d7a3 100644 --- a/plugin/forward/setup_policy_test.go +++ b/plugin/forward/setup_policy_test.go @@ -24,7 +24,7 @@ func TestSetupPolicy(t *testing.T) { for i, test := range tests { c := caddy.NewTestController("dns", test.input) - f, err := parseForward(c) + fs, err := parseForward(c) if test.shouldErr && err == nil { t.Errorf("Test %d: expected error but found %s for input %s", i, err, test.input) @@ -40,8 +40,8 @@ func TestSetupPolicy(t *testing.T) { } } - if !test.shouldErr && f.p.String() != test.expectedPolicy { - t.Errorf("Test %d: expected: %s, got: %s", i, test.expectedPolicy, f.p.String()) + if !test.shouldErr && (len(fs) == 0 || fs[0].p.String() != test.expectedPolicy) { + t.Errorf("Test %d: expected: %s, got: %s", i, test.expectedPolicy, fs[0].p.String()) } } } |