Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3c3526f

Browse files
fix test and build
1 parent 9e930b9 commit 3c3526f

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

benchmarks_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package gin
33
import (
44
"html/template"
55
"net/http"
6+
"os"
67
"testing"
78
)
89

@@ -36,7 +37,7 @@ func BenchmarkManyHandlers(B *testing.B) {
3637
}
3738

3839
func Benchmark5Params(B *testing.B) {
39-
DefaultWriter = newMockWriter()
40+
DefaultWriter = os.Stdout
4041
router := New()
4142
router.Use(func(c *Context) {})
4243
router.GET("/param/:param1/:params2/:param3/:param4/:param5", func(c *Context) {})

gin_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,27 +217,27 @@ func TestListOfRoutes(t *testing.T) {
217217
assertRoutePresent(t, list, RouteInfo{
218218
Method: "GET",
219219
Path: "/favicon.ico",
220-
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handler_test1$",
220+
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handlerTest1$",
221221
})
222222
assertRoutePresent(t, list, RouteInfo{
223223
Method: "GET",
224224
Path: "/",
225-
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handler_test1$",
225+
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handlerTest1$",
226226
})
227227
assertRoutePresent(t, list, RouteInfo{
228228
Method: "GET",
229229
Path: "/users/",
230-
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handler_test2$",
230+
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handlerTest2$",
231231
})
232232
assertRoutePresent(t, list, RouteInfo{
233233
Method: "GET",
234234
Path: "/users/:id",
235-
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handler_test1$",
235+
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handlerTest1$",
236236
})
237237
assertRoutePresent(t, list, RouteInfo{
238238
Method: "POST",
239239
Path: "/users/:id",
240-
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handler_test2$",
240+
Handler: "^(.*/vendor/)?github.com/gin-gonic/gin.handlerTest2$",
241241
})
242242
}
243243

githubapi_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"math/rand"
1111
"net/http"
1212
"net/http/httptest"
13+
"os"
1314
"testing"
1415

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

300301
func TestGithubAPI(t *testing.T) {
301-
DefaultWriter = newMockWriter()
302+
DefaultWriter = os.Stdout
302303
router := Default()
303304
githubConfigRouter(router)
304305

@@ -357,7 +358,7 @@ func BenchmarkGithub(b *testing.B) {
357358
}
358359

359360
func BenchmarkParallelGithub(b *testing.B) {
360-
DefaultWriter = newMockWriter()
361+
DefaultWriter = os.Stdout
361362
router := New()
362363
githubConfigRouter(router)
363364

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

375376
func BenchmarkParallelGithubDefault(b *testing.B) {
376-
DefaultWriter = newMockWriter()
377+
DefaultWriter = os.Stdout
377378
router := Default()
378379
githubConfigRouter(router)
379380

0 commit comments

Comments
 (0)