coredns-ldap/setup_test.go
Frederick F. Kautz IV 2960ad15e5 Migrating example to newer libraries
Signed-off-by: Frederick F. Kautz IV <fkautz@alumni.cmu.edu>
2019-07-10 00:39:00 -07:00

22 lines
495 B
Go

package example
import (
"testing"
"github.com/caddyserver/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)
}
}