[BUGFIX] test on tcp6 (instatt unix)

This commit is contained in:
Martin Geno 2017-05-29 22:04:05 +02:00
parent faff3e4f63
commit 5628d7db22
No known key found for this signature in database
GPG Key ID: F0D39A37E925E941
2 changed files with 9 additions and 9 deletions

View File

@ -12,7 +12,7 @@ import (
func TestConnectError(t *testing.T) { func TestConnectError(t *testing.T) {
assert := assert.New(t) assert := assert.New(t)
assert.Panics(func() { assert.Panics(func() {
Dial("unix", "/tmp/yanic-database-error.socket") Dial("tcp6", "[::]:30303")
}, "could connect") }, "could connect")
} }
@ -20,12 +20,12 @@ func TestRecieveMessages(t *testing.T) {
assert := assert.New(t) assert := assert.New(t)
server, err := socket.Connect(map[string]interface{}{ server, err := socket.Connect(map[string]interface{}{
"enable": true, "enable": true,
"type": "unix", "type": "tcp6",
"address": "/tmp/yanic-database.socket", "address": "[::]:1337",
}) })
assert.NoError(err) assert.NoError(err)
d := Dial("unix", "/tmp/yanic-database.socket") d := Dial("tcp6", "[::]:1337")
assert.NotNil(d) assert.NotNil(d)
go d.Start() go d.Start()
time.Sleep(5 * time.Millisecond) time.Sleep(5 * time.Millisecond)

View File

@ -26,8 +26,8 @@ func TestStartup(t *testing.T) {
assert.Error(err, "connection should not work") assert.Error(err, "connection should not work")
assert.Nil(conn) assert.Nil(conn)
config["type"] = "unix" config["type"] = "tcp6"
config["address"] = "/tmp/yanic-database.socket" config["address"] = "[::]:1337"
conn, err = Connect(config) conn, err = Connect(config)
assert.NoError(err, "connection should work") assert.NoError(err, "connection should work")
@ -42,14 +42,14 @@ func TestClient(t *testing.T) {
config := make(map[string]interface{}) config := make(map[string]interface{})
config["enable"] = true config["enable"] = true
config["type"] = "unix" config["type"] = "tcp6"
config["address"] = "/tmp/yanic-database2.socket" config["address"] = "[::]:1337"
conn, err := Connect(config) conn, err := Connect(config)
assert.NoError(err, "connection should work") assert.NoError(err, "connection should work")
assert.NotNil(conn) assert.NotNil(conn)
client, err := net.Dial("unix", "/tmp/yanic-database2.socket") client, err := net.Dial("tcp6", "[::]:1337")
assert.NoError(err, "connection should work") assert.NoError(err, "connection should work")
assert.NotNil(client) assert.NotNil(client)
time.Sleep(time.Duration(3) * time.Microsecond) time.Sleep(time.Duration(3) * time.Microsecond)