From a47f72a2b54a9104ce68047944c957a228b7f5b8 Mon Sep 17 00:00:00 2001 From: tigerwill90 Date: Tue, 27 Feb 2024 00:22:28 +0100 Subject: [PATCH] test(coverage/lookup): no path match --- fox_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fox_test.go b/fox_test.go index 0401b78..bafa77f 100644 --- a/fox_test.go +++ b/fox_test.go @@ -1988,11 +1988,17 @@ func TestRouter_Lookup(t *testing.T) { cc.Close() } - // No method + // No method match req := httptest.NewRequest("ANY", "/bar", nil) handler, cc, _ := f.Lookup(mockResponseWriter{}, req) assert.Nil(t, handler) assert.Nil(t, cc) + + // No path match + req = httptest.NewRequest(http.MethodGet, "/bar", nil) + handler, cc, _ = f.Lookup(mockResponseWriter{}, req) + assert.Nil(t, handler) + assert.Nil(t, cc) } func TestTree_Has(t *testing.T) {