"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "middleware_test.go" between
gin-1.7.6.tar.gz and gin-1.7.7.tar.gz

About: Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API (with much better performance).

middleware_test.go  (gin-1.7.6):middleware_test.go  (gin-1.7.7)
skipping to change at line 121 skipping to change at line 121
w := performRequest(router, "GET", "/") w := performRequest(router, "GET", "/")
// TEST // TEST
assert.Equal(t, http.StatusMethodNotAllowed, w.Code) assert.Equal(t, http.StatusMethodNotAllowed, w.Code)
assert.Equal(t, "ACEGHFDB", signature) assert.Equal(t, "ACEGHFDB", signature)
} }
func TestMiddlewareNoMethodDisabled(t *testing.T) { func TestMiddlewareNoMethodDisabled(t *testing.T) {
signature := "" signature := ""
router := New() router := New()
// NoMethod disabled
router.HandleMethodNotAllowed = false router.HandleMethodNotAllowed = false
router.Use(func(c *Context) { router.Use(func(c *Context) {
signature += "A" signature += "A"
c.Next() c.Next()
signature += "B" signature += "B"
}) })
router.Use(func(c *Context) { router.Use(func(c *Context) {
signature += "C" signature += "C"
c.Next() c.Next()
signature += "D" signature += "D"
}) })
skipping to change at line 147 skipping to change at line 150
signature += "G" signature += "G"
c.Next() c.Next()
signature += "H" signature += "H"
}) })
router.NoRoute(func(c *Context) { router.NoRoute(func(c *Context) {
signature += " X " signature += " X "
}) })
router.POST("/", func(c *Context) { router.POST("/", func(c *Context) {
signature += " XX " signature += " XX "
}) })
// RUN // RUN
w := performRequest(router, "GET", "/") w := performRequest(router, "GET", "/")
// TEST // TEST
assert.Equal(t, http.StatusNotFound, w.Code) assert.Equal(t, http.StatusNotFound, w.Code)
assert.Equal(t, "AC X DB", signature) assert.Equal(t, "AC X DB", signature)
} }
func TestMiddlewareAbort(t *testing.T) { func TestMiddlewareAbort(t *testing.T) {
signature := "" signature := ""
 End of changes. 3 change blocks. 
0 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)