Testing travis - 4

This commit is contained in:
Jithin James 2017-10-17 12:24:01 +05:30
parent 05daee8e88
commit 22fa468657

View File

@ -11,6 +11,7 @@ import (
"io" "io"
"log" "log"
"os" "os"
"strings"
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
@ -64,7 +65,9 @@ func TestDebugPrintRoutes(t *testing.T) {
defer teardown() defer teardown()
debugPrintRoute("GET", "/path/to/route/:param", HandlersChain{func(c *Context) {}, handlerNameTest}) debugPrintRoute("GET", "/path/to/route/:param", HandlersChain{func(c *Context) {}, handlerNameTest})
assert.Regexp(t, `^\[GIN-debug\] GET /path/to/route/:param --> (.*/vendor/)?github.com/gin-gonic/gin.handlerNameTest \(2 handlers\)\n$`, w.String()) s := w.String()
lines := strings.Split(s, "\n")
assert.Regexp(t, `^\[GIN-debug\] GET /path/to/route/:param --> (.*/vendor/)?github.com/jithinjk/gin.handlerNameTest \(2 handlers\)\n$`, lines[len(lines)-2]+"\n")
} }
func TestDebugPrintLoadTemplate(t *testing.T) { func TestDebugPrintLoadTemplate(t *testing.T) {