Skip to content

Commit

Permalink
test: simplify error comparison logic
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornplusplus committed Feb 14, 2024
1 parent 8d85c30 commit 9d5fdbe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/setup/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,9 @@ var sliceKeyTests = []struct {
}, {
input: "-foo_bar",
err: `invalid slice reference: "-foo_bar"`,
}, {
input: "foo+_bar",
expected: setup.SliceKey{Package: "foo+", Slice: "bar"},
}, {
input: "foo_slice123",
expected: setup.SliceKey{Package: "foo", Slice: "slice123"},
Expand All @@ -1201,7 +1204,7 @@ var sliceKeyTests = []struct {
func (s *S) TestParseSliceKey(c *C) {
for _, test := range sliceKeyTests {
key, err := setup.ParseSliceKey(test.input)
if err != nil || test.err != "" {
if test.err != "" {
c.Assert(err, ErrorMatches, test.err)
continue
}
Expand Down

0 comments on commit 9d5fdbe

Please sign in to comment.