diff options
author | 2018-01-06 14:52:09 -0500 | |
---|---|---|
committer | 2018-01-06 14:52:09 -0500 | |
commit | 84ebbbc7225a8d7eb5e00c0c525f7e12932a9fe4 (patch) | |
tree | 075407cf860a7e32c121dfc0d292fd389bf7a3c2 /plugin/plugin_test.go | |
parent | 75a8a17da4fc95c086dfb447d29c02e7dbd05561 (diff) | |
download | coredns-84ebbbc7225a8d7eb5e00c0c525f7e12932a9fe4.tar.gz coredns-84ebbbc7225a8d7eb5e00c0c525f7e12932a9fe4.tar.zst coredns-84ebbbc7225a8d7eb5e00c0c525f7e12932a9fe4.zip |
kubernetes: Add zone filtering to fallthrough (#1353)
* Add zone filtering to fallthrough
* Doh. gofmt
* Update documentation
Diffstat (limited to 'plugin/plugin_test.go')
-rw-r--r-- | plugin/plugin_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/plugin/plugin_test.go b/plugin/plugin_test.go index b0736c3a0..80c253843 100644 --- a/plugin/plugin_test.go +++ b/plugin/plugin_test.go @@ -1 +1,21 @@ package plugin + +import "testing" + +func TestFallthrough(t *testing.T) { + if Fallthrough(nil, "foo.com.") { + t.Errorf("Expected false, got true for nil fallthrough") + } + + if !Fallthrough(&[]string{}, "foo.net.") { + t.Errorf("Expected true, got false for all zone fallthrough") + } + + if Fallthrough(&[]string{"foo.com", "bar.com"}, "foo.net") { + t.Errorf("Expected false, got true for non-matching fallthrough zone") + } + + if !Fallthrough(&[]string{"foo.com.", "bar.com."}, "bar.com.") { + t.Errorf("Expected true, got false for matching fallthrough zone") + } +} |