Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var cleanTests = []cleanPathTest{
{"abc/../../././../def", "/def"},
}

func TestPathClean(t *testing.T) {
func TestCleanPath(t *testing.T) {
for _, test := range cleanTests {
if s := CleanPath(test.path); s != test.result {
t.Errorf("CleanPath(%q) = %q, want %q", test.path, s, test.result)
Expand All @@ -79,7 +79,7 @@ func TestPathClean(t *testing.T) {
}
}

func TestPathCleanMallocs(t *testing.T) {
func TestCleanPath_Mallocs(t *testing.T) {
if testing.Short() {
t.Skip("skipping malloc count in short mode")
}
Expand All @@ -93,7 +93,7 @@ func TestPathCleanMallocs(t *testing.T) {
}
}

func BenchmarkPathClean(b *testing.B) {
func BenchmarkCleanPath(b *testing.B) {
b.ReportAllocs()

for i := 0; i < b.N; i++ {
Expand Down Expand Up @@ -125,7 +125,7 @@ func genLongPaths() (testPaths []cleanPathTest) {
return testPaths
}

func TestPathCleanLong(t *testing.T) {
func TestCleanPath_Long(t *testing.T) {
cleanTests := genLongPaths()

for _, test := range cleanTests {
Expand All @@ -138,13 +138,13 @@ func TestPathCleanLong(t *testing.T) {
}
}

func TestFixTrailingSlash(t *testing.T) {
func Test_fixTrailingSlash(t *testing.T) {
assert.Equal(t, "/foo/", fixTrailingSlash("/foo"))
assert.Equal(t, "/foo", fixTrailingSlash("/foo/"))
assert.Equal(t, "/", fixTrailingSlash(""))
}

func BenchmarkPathCleanLong(b *testing.B) {
func BenchmarkCleanPath_Long(b *testing.B) {
cleanTests := genLongPaths()
b.ResetTimer()
b.ReportAllocs()
Expand All @@ -156,7 +156,7 @@ func BenchmarkPathCleanLong(b *testing.B) {
}
}

func TestEscapeLeadingSlashes(t *testing.T) {
func Test_escapeLeadingSlashes(t *testing.T) {
cases := []struct {
name string
uri string
Expand Down
6 changes: 3 additions & 3 deletions tree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestDomainLookup(t *testing.T) {
func Test_iTree_lookup_Domain(t *testing.T) {
cases := []struct {
name string
routes []string
Expand Down Expand Up @@ -1237,7 +1237,7 @@ func TestDomainLookup(t *testing.T) {
}
}

func TestMatchersLookup(t *testing.T) {
func Test_iTree_lookup_Matchers(t *testing.T) {

type route struct {
pattern string
Expand Down Expand Up @@ -1509,7 +1509,7 @@ func TestMatchersLookup(t *testing.T) {

}

func TestMatchersLookupWithPriority(t *testing.T) {
func Test_iTree_lookup_MatchersPriority(t *testing.T) {
type route struct {
pattern string
matchers []Matcher
Expand Down
Loading