Skip to content

Commit

Permalink
Merge pull request TechBowl-japan#31 from shake551/fix_test_assert_er…
Browse files Browse the repository at this point in the history
…ror_number

assert error number
  • Loading branch information
SuguruOoki authored Jan 13, 2023
2 parents c1182f5 + 8e05669 commit 5f26a23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions _test/sta12/sta12_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ func TestStation12(t *testing.T) {
t.Errorf("期待していないエラーの Type です, got = %t, want = %+v", err, sqlite3Err)
return
}
if err.(sqlite3.Error).Code != sqlite3.ErrConstraint {
t.Errorf("期待していないsqlite3のエラーナンバーです, got = %d, want = %d", err.(sqlite3.Error).Code, sqlite3.ErrConstraint)
return
}
return
}

Expand Down
4 changes: 4 additions & 0 deletions _test/sta8/sta8_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ func TestStation8(t *testing.T) {
if !errors.As(err, &sqlite3Err) {
t.Errorf("期待していないエラーの Type です, got = %t, want = %+v", err, sqlite3Err)
}
if err.(sqlite3.Error).Code != sqlite3.ErrConstraint {
t.Errorf("期待していないsqlite3のエラーナンバーです, got = %d, want = %d", err.(sqlite3.Error).Code, sqlite3.ErrConstraint)
return
}
return
}

Expand Down

0 comments on commit 5f26a23

Please sign in to comment.