mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 21:32:11 +08:00
Update gin_integration_test.go
test
This commit is contained in:
parent
a1f4f8406c
commit
1062d79a37
@ -70,21 +70,6 @@ func TestRunServer(t *testing.T) {
|
|||||||
testRequest(t, "http://localhost:8090/example")
|
testRequest(t, "http://localhost:8090/example")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRunTLS(t *testing.T) {
|
|
||||||
router := New()
|
|
||||||
go func() {
|
|
||||||
router.GET("/example", func(c *Context) { c.String(http.StatusOK, "it worked") })
|
|
||||||
|
|
||||||
assert.NoError(t, router.RunTLS(":8443", "./testdata/certificate/cert.pem", "./testdata/certificate/key.pem"))
|
|
||||||
}()
|
|
||||||
|
|
||||||
// have to wait for the goroutine to start and run the server
|
|
||||||
// otherwise the main thread will complete
|
|
||||||
time.Sleep(5 * time.Millisecond)
|
|
||||||
|
|
||||||
assert.Error(t, router.RunTLS(":8443", "./testdata/certificate/cert.pem", "./testdata/certificate/key.pem"))
|
|
||||||
testRequest(t, "https://localhost:8443/example")
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestPusher(t *testing.T) {
|
func TestPusher(t *testing.T) {
|
||||||
var html = template.Must(template.New("https").Parse(`
|
var html = template.Must(template.New("https").Parse(`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user