mirror of
https://github.com/coredns/coredns.git
synced 2026-01-01 06:21:19 -05:00
Add pkg/fall for Fallthrough (#1355)
* Add pkg/fall for Fallthrough Move this into it's own package to facilitate tests. Important bug was fixed: make the names fully qualified. Add fall package to hosts, reverse, etcd, and fix kubernetes and any tests. The k8s tests are still as-is, might need a future cleanup.
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user