Skip to content

Commit

Permalink
update switch cases in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsk committed Dec 29, 2017
1 parent 6abebb7 commit 2f3cce7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions cmd/retry/parser_gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,8 @@ func Test_handle_generated(t *testing.T) {
t.Errorf("unexpected error %q at {%s:%d} test case", err, tc.name, i)
case tc.error != "" && err == nil:
t.Errorf("expected error %q, obtained nil at {%s:%d} test case", tc.error, tc.name, i)
case tc.error != "" && err != nil:
if tc.error != err.Error() {
t.Errorf("expected error %q, obtained %q at {%s:%d} test case", tc.error, err, tc.name, i)
}
case tc.error != "" && err != nil && tc.error != err.Error():
t.Errorf("expected error %q, obtained %q at {%s:%d} test case", tc.error, err, tc.name, i)
case len(strategies) != tc.expected:
t.Errorf("expected %d strategies, obtained %d", tc.expected, len(strategies))
}
Expand Down
6 changes: 2 additions & 4 deletions cmd/retry/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,8 @@ func Test_handle(t *testing.T) {
t.Errorf("unexpected error %q at {%s:%d} test case", err, tc.name, i)
case tc.error != "" && err == nil:
t.Errorf("expected error %q, obtained nil at {%s:%d} test case", tc.error, tc.name, i)
case tc.error != "" && err != nil:
if tc.error != err.Error() {
t.Errorf("expected error %q, obtained %q at {%s:%d} test case", tc.error, err, tc.name, i)
}
case tc.error != "" && err != nil && tc.error != err.Error():
t.Errorf("expected error %q, obtained %q at {%s:%d} test case", tc.error, err, tc.name, i)
case len(strategies) != tc.expected:
t.Errorf("expected %d strategies, obtained %d", tc.expected, len(strategies))
}
Expand Down

0 comments on commit 2f3cce7

Please sign in to comment.