Skip to content

Commit

Permalink
fix test and build
Browse files Browse the repository at this point in the history
  • Loading branch information
javierprovecho committed Apr 14, 2016
1 parent 9e930b9 commit 3c3526f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion benchmarks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package gin
import (
"html/template"
"net/http"
"os"
"testing"
)

Expand Down Expand Up @@ -36,7 +37,7 @@ func BenchmarkManyHandlers(B *testing.B) {
}

func Benchmark5Params(B *testing.B) {
DefaultWriter = newMockWriter()
DefaultWriter = os.Stdout
router := New()
router.Use(func(c *Context) {})
router.GET("/param/:param1/:params2/:param3/:param4/:param5", func(c *Context) {})
Expand Down
10 changes: 5 additions & 5 deletions gin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,27 +217,27 @@ func TestListOfRoutes(t *testing.T) {
assertRoutePresent(t, list, RouteInfo{
Method: "GET",
Path: "/favicon.ico",
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handler_test1$",
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handlerTest1$",
})
assertRoutePresent(t, list, RouteInfo{
Method: "GET",
Path: "/",
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handler_test1$",
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handlerTest1$",
})
assertRoutePresent(t, list, RouteInfo{
Method: "GET",
Path: "/users/",
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handler_test2$",
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handlerTest2$",
})
assertRoutePresent(t, list, RouteInfo{
Method: "GET",
Path: "/users/:id",
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handler_test1$",
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handlerTest1$",
})
assertRoutePresent(t, list, RouteInfo{
Method: "POST",
Path: "/users/:id",
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handler_test2$",
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handlerTest2$",
})
}

Expand Down
7 changes: 4 additions & 3 deletions githubapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"math/rand"
"net/http"
"net/http/httptest"
"os"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -298,7 +299,7 @@ func githubConfigRouter(router *Engine) {
}

func TestGithubAPI(t *testing.T) {
DefaultWriter = newMockWriter()
DefaultWriter = os.Stdout
router := Default()
githubConfigRouter(router)

Expand Down Expand Up @@ -357,7 +358,7 @@ func BenchmarkGithub(b *testing.B) {
}

func BenchmarkParallelGithub(b *testing.B) {
DefaultWriter = newMockWriter()
DefaultWriter = os.Stdout
router := New()
githubConfigRouter(router)

Expand All @@ -373,7 +374,7 @@ func BenchmarkParallelGithub(b *testing.B) {
}

func BenchmarkParallelGithubDefault(b *testing.B) {
DefaultWriter = newMockWriter()
DefaultWriter = os.Stdout
router := Default()
githubConfigRouter(router)

Expand Down

0 comments on commit 3c3526f

Please sign in to comment.