Tons of unit tests

This commit is contained in:
Manu Mtz-Almeida
2015-04-09 12:15:02 +02:00
parent ac1ee3fb86
commit 0a192fb0fa
26 changed files with 1477 additions and 86 deletions
+10
View File
@@ -45,7 +45,17 @@ func TestFilterFlags(t *testing.T) {
assert.Equal(t, result, "text/html")
}
func TestFunctionName(t *testing.T) {
assert.Equal(t, nameOfFunction(somefunction), "github.com/gin-gonic/gin.somefunction")
}
func somefunction() {
}
func TestJoinPaths(t *testing.T) {
assert.Equal(t, joinPaths("", ""), "")
assert.Equal(t, joinPaths("", "/"), "/")
assert.Equal(t, joinPaths("/a", ""), "/a")
assert.Equal(t, joinPaths("/a/", ""), "/a/")
assert.Equal(t, joinPaths("/a/", "/"), "/a/")