add more testcases
This commit is contained in:
parent
10c0672a99
commit
1b7b7d6f74
|
@ -157,7 +157,7 @@ func main() {
|
|||
defer pprof.StopCPUProfile()
|
||||
}
|
||||
|
||||
dns.HandleFunc("miek.nl.", handleReflect)
|
||||
dns.HandleFunc(".", handleReflect)
|
||||
dns.HandleFunc("authors.bind.", dns.HandleAuthors)
|
||||
dns.HandleFunc("authors.server.", dns.HandleAuthors)
|
||||
dns.HandleFunc("version.bind.", dns.HandleVersion)
|
||||
|
|
|
@ -76,13 +76,23 @@ func TestDotAsCatchAllWildcard(t *testing.T) {
|
|||
mux.Handle(".", HandlerFunc(HelloServer))
|
||||
mux.Handle("example.com.", HandlerFunc(AnotherHelloServer))
|
||||
|
||||
handler := mux.match("www.mike.nl", TypeTXT)
|
||||
handler := mux.match("www.miek.nl.", TypeTXT)
|
||||
if handler == nil {
|
||||
t.Error("wildcard match failed")
|
||||
}
|
||||
|
||||
nhandler := mux.match("www.example.com", TypeTXT)
|
||||
if nhandler == nil {
|
||||
t.Error("match failed")
|
||||
handler = mux.match("www.example.com.", TypeTXT)
|
||||
if handler == nil {
|
||||
t.Error("example.com match failed")
|
||||
}
|
||||
|
||||
handler = mux.match("a.www.example.com.", TypeTXT)
|
||||
if handler == nil {
|
||||
t.Error("a.www.example.com match failed")
|
||||
}
|
||||
|
||||
handler = mux.match("boe.", TypeTXT)
|
||||
if handler == nil {
|
||||
t.Error("boe. match failed")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue