Test ServeMux's case folding

This commit is contained in:
Andrew Tunnell-Jones 2013-12-14 20:37:53 +11:00 committed by Miek Gieben
parent 58bb85e9b4
commit 33c8fd7aec
1 changed files with 15 additions and 0 deletions

View File

@ -138,6 +138,21 @@ func TestDotAsCatchAllWildcard(t *testing.T) {
}
}
func TestCaseFolding(t *testing.T) {
mux := NewServeMux()
mux.Handle("_udp.example.com.", HandlerFunc(HelloServer))
handler := mux.match("_dns._udp.example.com.", TypeSRV)
if handler == nil {
t.Error("case sensitive characters folded")
}
handler = mux.match("_DNS._UDP.EXAMPLE.COM.", TypeSRV)
if handler == nil {
t.Error("case insensitive characters not folded")
}
}
func TestRootServer(t *testing.T) {
mux := NewServeMux()
mux.Handle(".", HandlerFunc(HelloServer))