1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-11-23 21:44:44 +02:00

Use assert for test (#3201)

instead of `if`s
This commit is contained in:
qwerty287
2024-01-14 19:33:58 +01:00
committed by GitHub
parent b9f6f3f9fb
commit 001b5639a6
34 changed files with 417 additions and 1140 deletions

View File

@@ -86,9 +86,7 @@ func TestSplitVolumeParts(t *testing.T) {
for _, test := range testdata {
results, err := splitVolumeParts(test.from)
if test.success != (err == nil) {
if reflect.DeepEqual(results, test.to) != test.success {
t.Errorf("Expect %q matches %q is %v", test.from, results, test.to)
}
assert.Equal(t, test.success, reflect.DeepEqual(results, test.to))
}
}
}