Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
anilsenay committed Apr 26, 2024
1 parent 39d953e commit 8f11a31
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions error_translator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ func TestDialector_Translate(t *testing.T) {
args: args{err: &pgconn.PgError{Code: "42703"}},
want: gorm.ErrInvalidField,
},
{
name: "it should return gorm.ErrCheckConstraintViolated error if the status code is 23514",
args: args{err: &pgconn.PgError{Code: "23514"}},
want: gorm.ErrCheckConstraintViolated,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 8f11a31

Please sign in to comment.