mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-17 14:12:16 +08:00
Ignore Unix Socket tests on windows OS
This commit is contained in:
parent
3900df04d2
commit
d1dbeb02cb
@ -7,11 +7,13 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func testRequest(t *testing.T, url string) {
|
func testRequest(t *testing.T, url string) {
|
||||||
@ -77,6 +79,10 @@ func TestRunWithPort(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestUnixSocket(t *testing.T) {
|
func TestUnixSocket(t *testing.T) {
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
router := New()
|
router := New()
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
@ -101,6 +107,10 @@ func TestUnixSocket(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestBadUnixSocket(t *testing.T) {
|
func TestBadUnixSocket(t *testing.T) {
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
router := New()
|
router := New()
|
||||||
assert.Error(t, router.RunUnix("#/tmp/unix_unit_test"))
|
assert.Error(t, router.RunUnix("#/tmp/unix_unit_test"))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user