mirror of
https://github.com/gin-gonic/gin.git
synced 2025-05-20 00:47:00 +08:00
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:
@ -63,7 +63,7 @@ func TestDebugPrintRoutes(t *testing.T) {
|
||||
defer teardown()
|
||||
|
||||
debugPrintRoute("GET", "/path/to/route/:param", HandlersChain{func(c *Context) {}, handlerNameTest})
|
||||
assert.Equal(t, w.String(), "[GIN-debug] GET /path/to/route/:param --> github.com/gin-gonic/gin.handlerNameTest (2 handlers)\n")
|
||||
assert.Regexp(t, `^\[GIN-debug\] GET /path/to/route/:param --> (.*/vendor/)?github.com/gin-gonic/gin.handlerNameTest \(2 handlers\)\n$`, w.String())
|
||||
}
|
||||
|
||||
func setup(w io.Writer) {
|
||||
|
Reference in New Issue
Block a user