From 517d1edbe002135c41e99e9afd4cea90f7bc4767 Mon Sep 17 00:00:00 2001 From: Harshal Patel Date: Fri, 5 Jun 2026 23:27:21 +0530 Subject: [PATCH] test: add direct node evaluation test to achieve 100% patch coverage in tree.go --- tree_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tree_test.go b/tree_test.go index 23339af4..70cc4f4b 100644 --- a/tree_test.go +++ b/tree_test.go @@ -1111,3 +1111,20 @@ func TestTreeFindCaseInsensitivePathWildcardParamAndStaticChild(t *testing.T) { t.Errorf("Wrong result for '/prefix/something': %s", string(out)) } } + +func TestTreeWildcardParamImproperBoundaryCoverage(t *testing.T) { + tree := &node{} + + // Register a path with a wild named parameter segment + tree.addRoute("/submit/:info", HandlersChain{func(c *Context) {}}) + + // Pass a path containing a multi-byte sequence where a standard byte segment lookup + // drifts directly into the middle of a continuation block. + // This exercises our inner boundary alignment decrement loop. + path := "/submit/जय" + value := tree.getValue(path, &Params{}, nil, false) + + if value.handlers == nil { + t.Errorf("Routing fallback failed on multi-byte parameter verification evaluation.") + } +}