(t *testing.T, tree *node, requests testRequests)
| 40 | } |
| 41 | |
| 42 | func checkRequests(t *testing.T, tree *node, requests testRequests) { |
| 43 | for _, request := range requests { |
| 44 | handler, ps, _ := tree.getValue(request.path) |
| 45 | |
| 46 | if handler == nil { |
| 47 | if !request.nilHandler { |
| 48 | t.Errorf("handle mismatch for route '%s': Expected non-nil handle", request.path) |
| 49 | } |
| 50 | } else if request.nilHandler { |
| 51 | t.Errorf("handle mismatch for route '%s': Expected nil handle", request.path) |
| 52 | } else { |
| 53 | handler(nil, nil, nil) |
| 54 | if fakeHandlerValue != request.route { |
| 55 | t.Errorf("handle mismatch for route '%s': Wrong handle (%s != %s)", request.path, fakeHandlerValue, request.route) |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | if !reflect.DeepEqual(ps, request.ps) { |
| 60 | t.Errorf("Params mismatch for route '%s'", request.path) |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | func checkPriorities(t *testing.T, n *node) uint32 { |
| 66 | var prio uint32 |
no test coverage detected