mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-23 18:22:23 +08:00
add release mode cases
This commit is contained in:
parent
d44e155c12
commit
88563f9d78
30
gin_test.go
30
gin_test.go
@ -80,7 +80,6 @@ func setupHTMLGlob(t *testing.T, mode string, tls bool) func() {
|
||||
return func() {}
|
||||
}
|
||||
|
||||
//TODO
|
||||
func TestLoadHTMLGlob(t *testing.T) {
|
||||
td := setupHTMLGlob(t, DebugMode, false)
|
||||
res, err := http.Get("http://127.0.0.1:8888/test")
|
||||
@ -107,6 +106,19 @@ func TestLoadHTMLGlob2(t *testing.T) {
|
||||
td()
|
||||
}
|
||||
|
||||
func TestLoadHTMLGlob3(t *testing.T) {
|
||||
td := setupHTMLGlob(t, ReleaseMode, false)
|
||||
res, err := http.Get("http://127.0.0.1:8888/test")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
resp, _ := ioutil.ReadAll(res.Body)
|
||||
assert.Equal(t, "<h1>Hello world</h1>", string(resp[:]))
|
||||
|
||||
td()
|
||||
}
|
||||
|
||||
func TestLoadHTMLGlobUsingTLS(t *testing.T) {
|
||||
td := setupHTMLGlob(t, DebugMode, true)
|
||||
// Use InsecureSkipVerify for avoiding `x509: certificate signed by unknown authority` error
|
||||
@ -191,6 +203,18 @@ func TestLoadHTMLFiles2(t *testing.T) {
|
||||
td()
|
||||
}
|
||||
|
||||
func TestLoadHTMLFiles3(t *testing.T) {
|
||||
td := setupHTMLFiles(t, ReleaseMode, false)
|
||||
res, err := http.Get("http://127.0.0.1:8888/test")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
resp, _ := ioutil.ReadAll(res.Body)
|
||||
assert.Equal(t, "<h1>Hello world</h1>", string(resp[:]))
|
||||
td()
|
||||
}
|
||||
|
||||
func TestLoadHTMLFilesUsingTLS(t *testing.T) {
|
||||
td := setupHTMLFiles(t, TestMode, true)
|
||||
// Use InsecureSkipVerify for avoiding `x509: certificate signed by unknown authority` error
|
||||
@ -224,10 +248,6 @@ func TestLoadHTMLFilesFuncMap(t *testing.T) {
|
||||
td()
|
||||
}
|
||||
|
||||
func TestLoadHTMLReleaseMode(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
func TestAddRoute(t *testing.T) {
|
||||
router := New()
|
||||
router.addRoute("GET", "/", HandlersChain{func(_ *Context) {}})
|
||||
|
Loading…
x
Reference in New Issue
Block a user