blob: cfed98f90558cf4f2ac2f61e8a3907188bbf19d5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// +build linux darwin freebsd
package utils
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestCreateListener(t *testing.T) {
_, err := CreateListener("unexpected dsn")
assert.Error(t, err, "Invalid DSN (tcp://:6001, unix://file.sock)")
_, err = CreateListener("aaa://192.168.0.1")
assert.Error(t, err, "Invalid Protocol (tcp://:6001, unix://file.sock)")
}
func TestUnixCreateListener(t *testing.T) {
l, err := CreateListener("unix://file.sock")
assert.NoError(t, err)
l.Close()
}
|