tests: make path assertions aware of vendoring
The path of a package can change in a situation where dependency vendoring is in use. This change modifies gin's unit tests to allow such paths.
This commit is contained in:
@ -161,7 +161,7 @@ func TestContextHandlerName(t *testing.T) {
|
||||
c, _, _ := createTestContext()
|
||||
c.handlers = HandlersChain{func(c *Context) {}, handlerNameTest}
|
||||
|
||||
assert.Equal(t, c.HandlerName(), "github.com/gin-gonic/gin.handlerNameTest")
|
||||
assert.Regexp(t, "^(.*/vendor/)?github.com/gin-gonic/gin.handlerNameTest$", c.HandlerName())
|
||||
}
|
||||
|
||||
func handlerNameTest(c *Context) {
|
||||
|
Reference in New Issue
Block a user