@@ -105,8 +105,9 @@ func TestGetRawContent(t *testing.T) {
105105
106106 if test .wantErr {
107107 if err == nil {
108- t .Errorf ("GetRawContent() err = nil, want error containing %q" , test .wantErrSubstr )
109- } else if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
108+ t .Fatalf ("GetRawContent() err = nil, want error containing %q" , test .wantErrSubstr )
109+ }
110+ if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
110111 t .Errorf ("GetRawContent() err = %v, want error containing %q" , err , test .wantErrSubstr )
111112 }
112113 } else {
@@ -220,8 +221,9 @@ func TestFetchGitHubRepoFromRemote(t *testing.T) {
220221
221222 if test .wantErr {
222223 if err == nil {
223- t .Errorf ("FetchGitHubRepoFromRemote() err = nil, want error containing %q" , test .wantErrSubstr )
224- } else if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
224+ t .Fatalf ("FetchGitHubRepoFromRemote() err = nil, want error containing %q" , test .wantErrSubstr )
225+ }
226+ if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
225227 t .Errorf ("FetchGitHubRepoFromRemote() err = %v, want error containing %q" , err , test .wantErrSubstr )
226228 }
227229 } else {
@@ -276,8 +278,9 @@ func TestParseURL(t *testing.T) {
276278
277279 if test .wantErr {
278280 if err == nil {
279- t .Errorf ("ParseURL() err = nil, want error containing %q" , test .wantErrSubstr )
280- } else if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
281+ t .Fatalf ("ParseURL() err = nil, want error containing %q" , test .wantErrSubstr )
282+ }
283+ if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
281284 t .Errorf ("ParseURL() err = %v, want error containing %q" , err , test .wantErrSubstr )
282285 }
283286 } else {
@@ -335,8 +338,9 @@ func TestParseSSHRemote(t *testing.T) {
335338 repo , err := parseSSHRemote (test .remote )
336339 if test .wantErr {
337340 if err == nil {
338- t .Errorf ("ParseSSHRemote() err = nil, want error containing %q" , test .wantErrSubstr )
339- } else if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
341+ t .Fatalf ("ParseSSHRemote() err = nil, want error containing %q" , test .wantErrSubstr )
342+ }
343+ if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
340344 t .Errorf ("ParseSSHRemote() err = %v, want error containing %q" , err , test .wantErrSubstr )
341345 }
342346 } else {
@@ -440,8 +444,9 @@ func TestCreatePullRequest(t *testing.T) {
440444
441445 if test .wantErr {
442446 if err == nil {
443- t .Errorf ("CreatePullRequest() err = nil, want error containing %q" , test .wantErrSubstr )
444- } else if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
447+ t .Fatalf ("CreatePullRequest() err = nil, want error containing %q" , test .wantErrSubstr )
448+ }
449+ if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
445450 t .Errorf ("CreatePullRequest() err = %v, want error containing %q" , err , test .wantErrSubstr )
446451 }
447452 } else if err != nil {
@@ -507,7 +512,7 @@ func TestAddLabelsToIssue(t *testing.T) {
507512
508513 if test .wantErr {
509514 if err == nil {
510- t .Errorf ("AddLabelsToIssue() should return an error" )
515+ t .Fatal ("AddLabelsToIssue() should return an error" )
511516 }
512517 if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
513518 t .Errorf ("AddLabelsToIssue() err = %v, want error containing %q" , err , test .wantErrSubstr )
@@ -582,7 +587,7 @@ func TestGetLabels(t *testing.T) {
582587
583588 if test .wantErr {
584589 if err == nil {
585- t .Errorf ("GetLabels() should return an error" )
590+ t .Fatal ("GetLabels() should return an error" )
586591 }
587592 if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
588593 t .Errorf ("GetLabels() err = %v, want error containing %q" , err , test .wantErrSubstr )
@@ -655,7 +660,7 @@ func TestReplaceLabels(t *testing.T) {
655660
656661 if test .wantErr {
657662 if err == nil {
658- t .Errorf ("ReplaceLabels() should return an error" )
663+ t .Fatal ("ReplaceLabels() should return an error" )
659664 }
660665 if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
661666 t .Errorf ("ReplaceLabels() err = %v, want error containing %q" , err , test .wantErrSubstr )
@@ -761,8 +766,9 @@ func TestSearchPullRequests(t *testing.T) {
761766
762767 if test .wantErr {
763768 if err == nil {
764- t .Errorf ("SearchPullRequests() err = nil, want error containing %q" , test .wantErrSubstr )
765- } else if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
769+ t .Fatalf ("SearchPullRequests() err = nil, want error containing %q" , test .wantErrSubstr )
770+ }
771+ if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
766772 t .Errorf ("SearchPullRequests() err = %v, want error containing %q" , err , test .wantErrSubstr )
767773 }
768774 } else if err != nil {
@@ -824,8 +830,9 @@ func TestGetPullRequest(t *testing.T) {
824830
825831 if test .wantErr {
826832 if err == nil {
827- t .Errorf ("GetPullRequest() err = nil, want error containing %q" , test .wantErrSubstr )
828- } else if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
833+ t .Fatalf ("GetPullRequest() err = nil, want error containing %q" , test .wantErrSubstr )
834+ }
835+ if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
829836 t .Errorf ("GetPullRequest() err = %v, want error containing %q" , err , test .wantErrSubstr )
830837 }
831838 } else if err != nil {
@@ -901,8 +908,9 @@ func TestCreateRelease(t *testing.T) {
901908
902909 if test .wantErr {
903910 if err == nil {
904- t .Errorf ("CreateRelease() err = nil, want error containing %q" , test .wantErrSubstr )
905- } else if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
911+ t .Fatalf ("CreateRelease() err = nil, want error containing %q" , test .wantErrSubstr )
912+ }
913+ if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
906914 t .Errorf ("CreateRelease() err = %v, want error containing %q" , err , test .wantErrSubstr )
907915 }
908916 } else if err != nil {
@@ -970,8 +978,9 @@ func TestCreateIssueComment(t *testing.T) {
970978
971979 if test .wantErr {
972980 if err == nil {
973- t .Errorf ("CreateComment() err = nil, want error containing %q" , test .wantErrSubstr )
974- } else if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
981+ t .Fatalf ("CreateComment() err = nil, want error containing %q" , test .wantErrSubstr )
982+ }
983+ if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
975984 t .Errorf ("CreateComment() err = %v, want error containing %q" , err , test .wantErrSubstr )
976985 }
977986 } else if err != nil {
@@ -1033,8 +1042,9 @@ func TestFindMergedPullRequestsWithPendingReleaseLabel(t *testing.T) {
10331042
10341043 if test .wantErr {
10351044 if err == nil {
1036- t .Errorf ("FindMergedPullRequestsWithPendingReleaseLabel() err = nil, want error containing %q" , test .wantErrSubstr )
1037- } else if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
1045+ t .Fatalf ("FindMergedPullRequestsWithPendingReleaseLabel() err = nil, want error containing %q" , test .wantErrSubstr )
1046+ }
1047+ if ! strings .Contains (err .Error (), test .wantErrSubstr ) {
10381048 t .Errorf ("FindMergedPullRequestsWithPendingReleaseLabel() err = %v, want error containing %q" , err , test .wantErrSubstr )
10391049 }
10401050 } else if err != nil {
@@ -1100,7 +1110,7 @@ func TestCreateTag(t *testing.T) {
11001110
11011111 if test .wantErr {
11021112 if err == nil {
1103- t .Errorf ("CreateTag() err = nil, expected error" )
1113+ t .Fatal ("CreateTag() err = nil, expected error" )
11041114 }
11051115 } else if err != nil {
11061116 t .Errorf ("CreateTag() err = %v, want nil" , err )
0 commit comments