summaryrefslogtreecommitdiff
path: root/util/network_test.go
diff options
context:
space:
mode:
authorDmitry Patsura <[email protected]>2019-06-14 12:28:56 +0300
committerDmitry Patsura <[email protected]>2019-06-14 12:28:56 +0300
commitac126193fb36fdf248336fa433cbd13602f2ae75 (patch)
treea85abba72b65134a067f4f799b5e1d88a5101d3b /util/network_test.go
parenta612f9d4ac8d2f5659a2e984067baf5a11fd6c2a (diff)
Feature: Add tests for CreateListener
Diffstat (limited to 'util/network_test.go')
-rw-r--r--util/network_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/util/network_test.go b/util/network_test.go
new file mode 100644
index 00000000..bdc7e0b7
--- /dev/null
+++ b/util/network_test.go
@@ -0,0 +1,14 @@
+package util
+
+import (
+ "github.com/stretchr/testify/assert"
+ "testing"
+)
+
+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)")
+}