From 12d765af3a84c3a5351857dfc7f49c108e7939c2 Mon Sep 17 00:00:00 2001 From: 178inaba <178inaba@users.noreply.github.com> Date: Fri, 28 Apr 2017 14:46:19 +0900 Subject: [PATCH] Fix TestStreamingWSHashtag --- streaming_ws_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/streaming_ws_test.go b/streaming_ws_test.go index e82bd48..c13a7cc 100644 --- a/streaming_ws_test.go +++ b/streaming_ws_test.go @@ -44,11 +44,17 @@ func TestStreamingWSHashtag(t *testing.T) { client := NewClient(&Config{Server: ts.URL}).NewWSClient() ctx, cancel := context.WithCancel(context.Background()) - q, err := client.StreamingWSHashtag(ctx, "zzz", false) + q, err := client.StreamingWSHashtag(ctx, "zzz", true) if err != nil { t.Fatalf("should not be fail: %v", err) } + wsTest(t, q, cancel) + ctx, cancel = context.WithCancel(context.Background()) + q, err = client.StreamingWSHashtag(ctx, "zzz", false) + if err != nil { + t.Fatalf("should not be fail: %v", err) + } wsTest(t, q, cancel) } @@ -107,7 +113,7 @@ func wsTest(t *testing.T, q chan Event, cancel func()) { events = append(events, e) } if len(events) != 4 { - t.Fatalf("result should be two: %d", len(events)) + t.Fatalf("result should be four: %d", len(events)) } if events[0].(*UpdateEvent).Status.Content != "foo" { t.Fatalf("want %q but %q", "foo", events[0].(*UpdateEvent).Status.Content)