aboutsummaryrefslogtreecommitdiff
path: root/client_unix_test.go
diff options
context:
space:
mode:
authorGravatar Aleksandr Razumov <ar@cydev.ru> 2016-05-04 13:22:35 +0300
committerGravatar Aleksandr Razumov <ar@cydev.ru> 2016-05-04 13:22:35 +0300
commit0f298a79696589a80c1b37e3b82fdf564c0cdd3a (patch)
tree987161a26f7985482d087c6de03663ec8e40d660 /client_unix_test.go
parentfix tests on Windows (diff)
downloadfasthttp-0f298a79696589a80c1b37e3b82fdf564c0cdd3a.tar.gz
fasthttp-0f298a79696589a80c1b37e3b82fdf564c0cdd3a.tar.bz2
fasthttp-0f298a79696589a80c1b37e3b82fdf564c0cdd3a.zip
fix tests on unix
Diffstat (limited to 'client_unix_test.go')
-rw-r--r--client_unix_test.go44
1 files changed, 44 insertions, 0 deletions
diff --git a/client_unix_test.go b/client_unix_test.go
new file mode 100644
index 0000000..071c899
--- /dev/null
+++ b/client_unix_test.go
@@ -0,0 +1,44 @@
+// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris
+
+package fasthttp
+
+import (
+ "sync"
+ "testing"
+)
+
+func TestHostClientGet(t *testing.T) {
+ addr := "./TestHostClientGet.unix"
+ s := startEchoServer(t, "unix", addr)
+ defer s.Stop()
+ c := createEchoClient(t, "unix", addr)
+
+ testHostClientGet(t, c, 100)
+}
+
+func TestHostClientPost(t *testing.T) {
+ addr := "./TestHostClientPost.unix"
+ s := startEchoServer(t, "unix", addr)
+ defer s.Stop()
+ c := createEchoClient(t, "unix", addr)
+
+ testHostClientPost(t, c, 100)
+}
+
+func TestHostClientConcurrent(t *testing.T) {
+ addr := "./TestHostClientConcurrent.unix"
+ s := startEchoServer(t, "unix", addr)
+ defer s.Stop()
+ c := createEchoClient(t, "unix", addr)
+
+ var wg sync.WaitGroup
+ for i := 0; i < 10; i++ {
+ wg.Add(1)
+ go func() {
+ defer wg.Done()
+ testHostClientGet(t, c, 30)
+ testHostClientPost(t, c, 10)
+ }()
+ }
+ wg.Wait()
+}