Skip to content

Commit 5ed2f49

Browse files
committed
add tests
1 parent c122b16 commit 5ed2f49

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mmv1/third_party/terraform/tpgresource/utils_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,10 @@ func TestConflictError(t *testing.T) {
973973
t.Error("did not find that a 409 was a conflict error.")
974974
}
975975
if !tpgresource.IsConflictError(errwrap.Wrapf("wrap", confErr)) {
976-
t.Error("did not find that a wrapped 409 was a conflict error.")
976+
t.Error("did not find that a wrapped (errwrap) 409 was a conflict error.")
977+
}
978+
if !tpgresource.IsConflictError(fmt.Errorf("wrap: %w", confErr)) {
979+
t.Error("did not find that a wrapped (fmt.Errorf) 409 was a conflict error.")
977980
}
978981
confErr = &googleapi.Error{
979982
Code: 412,
@@ -984,6 +987,9 @@ func TestConflictError(t *testing.T) {
984987
if !tpgresource.IsConflictError(errwrap.Wrapf("wrap", confErr)) {
985988
t.Error("did not find that a wrapped 412 was a conflict error.")
986989
}
990+
if !tpgresource.IsConflictError(fmt.Errorf("wrap: %w", confErr)) {
991+
t.Error("did not find that a wrapped (fmt.Errorf) 412 was a conflict error.")
992+
}
987993
// skipping negative tests as other cases may be added later.
988994
}
989995

0 commit comments

Comments
 (0)