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

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Aug 21, 2020
1 parent 8aa2165 commit 428ceb2
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions tree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@ import (
"github.com/stretchr/testify/assert"
)

func printChildren(n *node, prefix string) {
fmt.Printf(" %02d %s%s[%d] %v %t %d \r\n", n.priority, prefix, n.path, len(n.children), n.route, n.wildChild, n.nType)
for l := len(n.path); l > 0; l-- {
prefix += " "
}
for _, child := range n.children {
printChildren(child, prefix)
}
}

// Used as a workaround since we can't compare functions or their addresses
var fakeHandlerValue string

Expand Down Expand Up @@ -105,8 +95,6 @@ func TestTreeAddAndGet(t *testing.T) {
tree.addRoute(route, newRoute(route, fakeHandler(route)))
}

//printChildren(tree, "")

checkRequests(t, tree, testRequests{
{"/a", false, "/a", nil},
{"/", true, "", nil},
Expand Down Expand Up @@ -147,8 +135,6 @@ func TestTreeWildcard(t *testing.T) {
tree.addRoute(route, newRoute(route, fakeHandler(route)))
}

//printChildren(tree, "")

checkRequests(t, tree, testRequests{
{"/", false, "/", nil},
{"/cmd/test/", false, "/cmd/:tool/", Params{Param{"tool", "test"}}},
Expand Down Expand Up @@ -204,8 +190,6 @@ func testRoutes(t *testing.T, routes []testRoute) {
assert.Nilf(t, recv, "unexpected panic for route '%s': %v", route.path, recv)
}
}

//printChildren(tree, "")
}

func TestTreeWildcardConflict(t *testing.T) {
Expand Down Expand Up @@ -268,8 +252,6 @@ func TestTreeDupliatePath(t *testing.T) {
assert.NotNilf(t, recv, "no panic while inserting duplicate route '%s", route)
}

//printChildren(tree, "")

checkRequests(t, tree, testRequests{
{"/", false, "/", nil},
{"/doc/", false, "/doc/", nil},
Expand Down Expand Up @@ -389,8 +371,6 @@ func TestTreeTrailingSlashRedirect(t *testing.T) {
assert.Nilf(t, recv, "panic inserting route '%s'", route)
}

//printChildren(tree, "")

tsrRoutes := [...]string{
"/hi/",
"/b",
Expand Down

0 comments on commit 428ceb2

Please sign in to comment.