1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 03:17:04 +00:00

Add notes for the new lead maintainer of the open-source iris project and align with @get-ion/ion by @hiveminded

Former-commit-id: da4f38eb9034daa49446df3ee529423b98f9b331
This commit is contained in:
kataras
2017-07-10 18:32:42 +03:00
parent 2d4c2779a7
commit 9f85b74fc9
344 changed files with 4842 additions and 5174 deletions

29
core/router/path_test.go Normal file
View File

@@ -0,0 +1,29 @@
package router
import (
"testing"
)
func TestSplitSubdomainAndPath(t *testing.T) {
tests := []struct {
original string
subdomain string
path string
}{
{"admin./users/42", "admin.", "/users/42"},
{"//api/users\\42", "", "/api/users/42"},
{"admin./users/\\42", "admin.", "/users/42"},
{"*./users/\\42", "*.", "/users/42"},
}
for i, tt := range tests {
subdomain, path := splitSubdomainAndPath(tt.original)
if expected, got := tt.subdomain, subdomain; expected != got {
t.Fatalf("[%d] - expected subdomain '%s' but got '%s'", i, expected, got)
}
if expected, got := tt.path, path; expected != got {
t.Fatalf("[%d] - expected path '%s' but got '%s'", i, expected, got)
}
}
}