Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Commit

Permalink
Remove superfluous conversions to string
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Aug 21, 2020
1 parent 428ceb2 commit 3adedb6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,13 +475,13 @@ func TestTreeFindCaseInsensitivePath(t *testing.T) {
for _, route := range routes {
out, found := tree.findCaseInsensitivePath(route, true)
assert.Truef(t, found, "Route '%s' not found!", route)
assert.Equalf(t, route, string(out), "Wrong result for route '%s'", route)
assert.Equalf(t, route, out, "Wrong result for route '%s'", route)
}
// With fixTrailingSlash = false
for _, route := range routes {
out, found := tree.findCaseInsensitivePath(route, false)
assert.Truef(t, found, "Route '%s' not found!", route)
assert.Equalf(t, route, string(out), "Wrong result for route '%s'", route)
assert.Equalf(t, route, out, "Wrong result for route '%s'", route)
}

tests := []struct {
Expand Down Expand Up @@ -552,19 +552,19 @@ func TestTreeFindCaseInsensitivePath(t *testing.T) {
out, found := tree.findCaseInsensitivePath(test.in, true)
assert.Equal(t, test.found, found)
if found {
assert.Equal(t, test.out, string(out))
assert.Equal(t, test.out, out)
}
}
// With fixTrailingSlash = false
for _, test := range tests {
out, found := tree.findCaseInsensitivePath(test.in, false)
if test.slash {
// test needs a trailingSlash fix. It must not be found!
assert.Falsef(t, found, "Found without fixTrailingSlash: %s; got %s", test.in, string(out))
assert.Falsef(t, found, "Found without fixTrailingSlash: %s; got %s", test.in, out)
} else {
assert.Equal(t, test.found, found)
if found {
assert.Equal(t, test.out, string(out))
assert.Equal(t, test.out, out)
}
}
}
Expand Down

0 comments on commit 3adedb6

Please sign in to comment.