From 22519353c320757eef7e57aee82134a00d468a40 Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Mon, 15 Aug 2016 21:55:43 +0800 Subject: [PATCH] Check Read --- transport/internet/ws/ws_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/transport/internet/ws/ws_test.go b/transport/internet/ws/ws_test.go index c76f59cf..25f7fdef 100644 --- a/transport/internet/ws/ws_test.go +++ b/transport/internet/ws/ws_test.go @@ -21,6 +21,10 @@ func Test_Connect_ws(t *testing.T) { go func() { buf := make([]byte, 4) conn.Read(buf) + str := string(buf) + if str != "echo" { + assert.Fail("Data mismatch") + } s <- 0 }() <-s @@ -37,6 +41,10 @@ func Test_Connect_wss(t *testing.T) { go func() { buf := make([]byte, 4) conn.Read(buf) + str := string(buf) + if str != "echo" { + assert.Fail("Data mismatch") + } s <- 0 }() <-s @@ -53,6 +61,10 @@ func Test_Connect_wss_1_nil(t *testing.T) { go func() { buf := make([]byte, 4) conn.Read(buf) + str := string(buf) + if str != "echo" { + assert.Fail("Data mismatch") + } s <- 0 }() <-s @@ -69,6 +81,10 @@ func Test_Connect_ws_guess(t *testing.T) { go func() { buf := make([]byte, 4) conn.Read(buf) + str := string(buf) + if str != "echo" { + assert.Fail("Data mismatch") + } s <- 0 }() <-s @@ -85,6 +101,10 @@ func Test_Connect_wss_guess(t *testing.T) { go func() { buf := make([]byte, 4) conn.Read(buf) + str := string(buf) + if str != "echo" { + assert.Fail("Data mismatch") + } s <- 0 }() <-s @@ -117,6 +137,10 @@ func Test_Connect_wss_guess_reuse(t *testing.T) { go func() { buf := make([]byte, 4) conn.Read(buf) + str := string(buf) + if str != "echo" { + assert.Fail("Data mismatch") + } s <- 0 }() <-s