Skip to content

Commit 8562b55

Browse files
committed
fix: use assert.ErrorContains for cleaner error assertion
Replace two-line assertion pattern (assert.NotNil + assert.Contains) with single assert.ErrorContains call for more idiomatic test code. Signed-off-by: 7908837174 <[email protected]>
1 parent 4efe108 commit 8562b55

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

corim/signedcorim_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ func TestSignedCorim_TaggedFromCOSE_bad(t *testing.T) {
198198
var actual SignedCorim
199199
err := actual.FromCOSE(tv)
200200

201-
assert.NotNil(t, err)
202-
assert.Contains(t, err.Error(), "tag validation failed")
201+
assert.ErrorContains(t, err, "tag validation failed")
203202
}
204203

205204
func TestSignedCorim_FromCOSE_fail_no_tag(t *testing.T) {

0 commit comments

Comments
 (0)