Merge pull request #1595 from mtrmac/ErrorContains

Use assert.ErrorContains
This commit is contained in:
Miloslav Trmač 2022-03-16 16:04:38 +01:00 committed by GitHub
commit 0bfe297fc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,9 +25,8 @@ const (
// Test that results of runSkopeo failed with nothing on stdout, and substring
// within the error message.
func assertTestFailed(t *testing.T, stdout string, err error, substring string) {
assert.Error(t, err)
assert.ErrorContains(t, err, substring)
assert.Empty(t, stdout)
assert.Contains(t, err.Error(), substring)
}
func TestStandaloneSign(t *testing.T) {