Skip to content

Commit 461dd37

Browse files
committed
update echox tests to work with normalized paths
An update in v4.12.0 introduced normalized paths which ensures empty paths or paths without a prefixed `/` start with a `/`. This is something we ran into previously which is why we had these tests. Now that these routes are handled properly, we needed to update our tests as all paths are prefixed with `/` now. Relevant PR: labstack/echo#2616 Signed-off-by: Mike Mason <[email protected]>
1 parent f3cc20b commit 461dd37

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

echox/echo_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ func TestHandler(t *testing.T) {
282282
routes = append(routes, route.Path)
283283
}
284284

285-
assert.Contains(t, routes, "baseline", "expected baseline to exist in route list")
286-
assert.Contains(t, routes, tc.path, "expected %s to exist in route list", tc.path)
285+
assert.Contains(t, routes, "/baseline", "expected baseline to exist in route list")
286+
assert.Contains(t, routes, "/"+strings.TrimLeft(tc.path, "/"), "expected /%s to exist in route list", tc.path)
287287

288288
w := httptest.NewRecorder()
289289

0 commit comments

Comments
 (0)