mirror of
https://github.com/linka-cloud/coredns-split.git
synced 2024-11-16 01:36:24 +00:00
22 lines
491 B
Go
22 lines
491 B
Go
package example
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/coredns/caddy"
|
|
)
|
|
|
|
// TestSetup tests the various things that should be parsed by setup.
|
|
// Make sure you also test for parse errors.
|
|
func TestSetup(t *testing.T) {
|
|
c := caddy.NewTestController("dns", `example`)
|
|
if err := setup(c); err != nil {
|
|
t.Fatalf("Expected no errors, but got: %v", err)
|
|
}
|
|
|
|
c = caddy.NewTestController("dns", `example more`)
|
|
if err := setup(c); err == nil {
|
|
t.Fatalf("Expected errors, but got: %v", err)
|
|
}
|
|
}
|