Skip to content

Commit 574f375

Browse files
committed
tree_test: remove superfluous conversions to string
1 parent 6a662d8 commit 574f375

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tree_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,8 @@ func TestTreeFindCaseInsensitivePath(t *testing.T) {
525525
out, found := tree.findCaseInsensitivePath(route, true)
526526
if !found {
527527
t.Errorf("Route '%s' not found!", route)
528-
} else if string(out) != route {
529-
t.Errorf("Wrong result for route '%s': %s", route, string(out))
528+
} else if out != route {
529+
t.Errorf("Wrong result for route '%s': %s", route, out)
530530
}
531531
}
532532
// With fixTrailingSlash = false
@@ -535,8 +535,8 @@ func TestTreeFindCaseInsensitivePath(t *testing.T) {
535535
out, found := tree.findCaseInsensitivePath(route, false)
536536
if !found {
537537
t.Errorf("Route '%s' not found!", route)
538-
} else if string(out) != route {
539-
t.Errorf("Wrong result for route '%s': %s", route, string(out))
538+
} else if out != route {
539+
t.Errorf("Wrong result for route '%s': %s", route, out)
540540
}
541541
}
542542

@@ -606,9 +606,9 @@ func TestTreeFindCaseInsensitivePath(t *testing.T) {
606606
// With fixTrailingSlash = true
607607
for _, test := range tests {
608608
out, found := tree.findCaseInsensitivePath(test.in, true)
609-
if found != test.found || (found && (string(out) != test.out)) {
609+
if found != test.found || (found && (out != test.out)) {
610610
t.Errorf("Wrong result for '%s': got %s, %t; want %s, %t",
611-
test.in, string(out), found, test.out, test.found)
611+
test.in, out, found, test.out, test.found)
612612
return
613613
}
614614
}
@@ -617,12 +617,12 @@ func TestTreeFindCaseInsensitivePath(t *testing.T) {
617617
out, found := tree.findCaseInsensitivePath(test.in, false)
618618
if test.slash {
619619
if found { // test needs a trailingSlash fix. It must not be found!
620-
t.Errorf("Found without fixTrailingSlash: %s; got %s", test.in, string(out))
620+
t.Errorf("Found without fixTrailingSlash: %s; got %s", test.in, out)
621621
}
622622
} else {
623-
if found != test.found || (found && (string(out) != test.out)) {
623+
if found != test.found || (found && (out != test.out)) {
624624
t.Errorf("Wrong result for '%s': got %s, %t; want %s, %t",
625-
test.in, string(out), found, test.out, test.found)
625+
test.in, out, found, test.out, test.found)
626626
return
627627
}
628628
}

0 commit comments

Comments
 (0)