coredns-ldap/setup_test.go

22 lines
486 B
Go
Raw Normal View History

2020-06-01 07:48:07 +00:00
package ldap
import (
"testing"
"github.com/caddyserver/caddy"
)
2018-02-25 08:52:52 +00:00
// TestSetup tests the various things that should be parsed by setup.
// Make sure you also test for parse errors.
func TestSetup(t *testing.T) {
2020-06-01 07:48:07 +00:00
c := caddy.NewTestController("dns", `ldap`)
if err := setup(c); err != nil {
t.Fatalf("Expected no errors, but got: %v", err)
}
2020-06-01 07:48:07 +00:00
c = caddy.NewTestController("dns", `ldap more`)
if err := setup(c); err == nil {
t.Fatalf("Expected errors, but got: %v", err)
}
}