(t *testing.T)
| 674 | } |
| 675 | |
| 676 | func TestTreeRootTrailingSlashRedirect(t *testing.T) { |
| 677 | tree := &node{} |
| 678 | |
| 679 | recv := catchPanic(func() { |
| 680 | tree.addRoute("/:test", fakeHandler("/:test")) |
| 681 | }) |
| 682 | if recv != nil { |
| 683 | t.Fatalf("panic inserting test route: %v", recv) |
| 684 | } |
| 685 | |
| 686 | value := tree.getValue("/", nil, getSkippedNodes(), false) |
| 687 | if value.handlers != nil { |
| 688 | t.Fatalf("non-nil handler") |
| 689 | } else if value.tsr { |
| 690 | t.Errorf("expected no TSR recommendation") |
| 691 | } |
| 692 | } |
| 693 | |
| 694 | func TestRedirectTrailingSlash(t *testing.T) { |
| 695 | data := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…