From f088c650a58c1eff8b2b6fe51d7e4b8e9762200f Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 18 Jul 2019 14:21:24 +0200 Subject: all: replace t.Log(); t.FailNow() with t.Fatal() (#19849) --- rpc/websocket_test.go | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'rpc') diff --git a/rpc/websocket_test.go b/rpc/websocket_test.go index 5bf3780d6..2caede474 100644 --- a/rpc/websocket_test.go +++ b/rpc/websocket_test.go @@ -21,34 +21,26 @@ import "testing" func TestWSGetConfigNoAuth(t *testing.T) { config, err := wsGetConfig("ws://example.com:1234", "") if err != nil { - t.Logf("wsGetConfig failed: %s", err) - t.Fail() - return + t.Fatalf("wsGetConfig failed: %s", err) } if config.Location.User != nil { - t.Log("User should have been stripped from the URL") - t.Fail() + t.Fatalf("User should have been stripped from the URL") } if config.Location.Hostname() != "example.com" || config.Location.Port() != "1234" || config.Location.Scheme != "ws" { - t.Logf("Unexpected URL: %s", config.Location) - t.Fail() + t.Fatalf("Unexpected URL: %s", config.Location) } } func TestWSGetConfigWithBasicAuth(t *testing.T) { config, err := wsGetConfig("wss://testuser:test-PASS_01@example.com:1234", "") if err != nil { - t.Logf("wsGetConfig failed: %s", err) - t.Fail() - return + t.Fatalf("wsGetConfig failed: %s", err) } if config.Location.User != nil { - t.Log("User should have been stripped from the URL") - t.Fail() + t.Fatal("User should have been stripped from the URL") } if config.Header.Get("Authorization") != "Basic dGVzdHVzZXI6dGVzdC1QQVNTXzAx" { - t.Log("Basic auth header is incorrect") - t.Fail() + t.Fatal("Basic auth header is incorrect") } } -- cgit v1.2.3