aboutsummaryrefslogtreecommitdiff
path: root/plugin/plugin_test.go
blob: 80c2538430b317f609d4b04bb1f189457bea425e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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")
	}
}