aboutsummaryrefslogtreecommitdiff
path: root/plugin/plugin_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/plugin_test.go')
-rw-r--r--plugin/plugin_test.go20
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")
+ }
+}