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:
Philipp Meinen
2015-08-21 20:57:53 +02:00
parent 704d690ac0
commit 9fd8aff56e
4 changed files with 23 additions and 13 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ func TestFilterFlags(t *testing.T) {
}
func TestFunctionName(t *testing.T) {
assert.Equal(t, nameOfFunction(somefunction), "github.com/gin-gonic/gin.somefunction")
assert.Regexp(t, `^(.*/vendor/)?github.com/gin-gonic/gin.somefunction$`, nameOfFunction(somefunction))
}
func somefunction() {