Skip to content

Commit

Permalink
TestSetUniqueTogether: fix sqlite test expectation (force err string …
Browse files Browse the repository at this point in the history
…to lower)
  • Loading branch information
James Cooper committed May 14, 2014
1 parent f296a21 commit eeb38f7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gorp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ func TestSetUniqueTogether(t *testing.T) {
t.Error(err)
}
// "unique" for Postgres/SQLite, "Duplicate entry" for MySQL
if !strings.Contains(err.Error(), "unique") && !strings.Contains(err.Error(), "Duplicate entry") {
errLower := strings.ToLower(err.Error())
if !strings.Contains(errLower, "unique") && !strings.Contains(errLower, "duplicate entry") {
t.Error(err)
}

Expand All @@ -317,7 +318,8 @@ func TestSetUniqueTogether(t *testing.T) {
t.Error(err)
}
// "unique" for Postgres/SQLite, "Duplicate entry" for MySQL
if !strings.Contains(err.Error(), "unique") && !strings.Contains(err.Error(), "Duplicate entry") {
errLower = strings.ToLower(err.Error())
if !strings.Contains(errLower, "unique") && !strings.Contains(errLower, "duplicate entry") {
t.Error(err)
}

Expand Down

0 comments on commit eeb38f7

Please sign in to comment.