From 80c1d52a0d487d0f46aeeef738807e4d9f7b3e06 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Mon, 30 Sep 2019 17:04:44 +0900 Subject: [PATCH] Fix tests --- apps_test.go | 2 +- mastodon_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps_test.go b/apps_test.go index f62bf15..32e28ab 100644 --- a/apps_test.go +++ b/apps_test.go @@ -92,7 +92,7 @@ func TestRegisterAppWithCancel(t *testing.T) { if err == nil { t.Fatalf("should be fail: %v", err) } - if want := "Post " + ts.URL + "/api/v1/apps: context canceled"; want != err.Error() { + if want := fmt.Sprintf("Post %q: context canceled", ts.URL+"/api/v1/apps"); want != err.Error() { t.Fatalf("want %q but %q", want, err.Error()) } } diff --git a/mastodon_test.go b/mastodon_test.go index 1379230..bfcbadc 100644 --- a/mastodon_test.go +++ b/mastodon_test.go @@ -138,7 +138,7 @@ func TestAuthenticateWithCancel(t *testing.T) { if err == nil { t.Fatalf("should be fail: %v", err) } - if want := "Post " + ts.URL + "/oauth/token: context canceled"; want != err.Error() { + if want := fmt.Sprintf("Post %q: context canceled", ts.URL+"/oauth/token"); want != err.Error() { t.Fatalf("want %q but %q", want, err.Error()) } } @@ -200,7 +200,7 @@ func TestPostStatusWithCancel(t *testing.T) { if err == nil { t.Fatalf("should be fail: %v", err) } - if want := "Post " + ts.URL + "/api/v1/statuses: context canceled"; want != err.Error() { + if want := fmt.Sprintf("Post %q: context canceled", ts.URL+"/api/v1/statuses"); want != err.Error() { t.Fatalf("want %q but %q", want, err.Error()) } } @@ -264,7 +264,7 @@ func TestGetTimelineHomeWithCancel(t *testing.T) { if err == nil { t.Fatalf("should be fail: %v", err) } - if want := "Get " + ts.URL + "/api/v1/timelines/home: context canceled"; want != err.Error() { + if want := fmt.Sprintf("Post %q: context canceled", ts.URL+"/api/v1/timelines/home"); want != err.Error() { t.Fatalf("want %q but %q", want, err.Error()) } }