Skip to content

Commit

Permalink
Add a simple test for the sql.Connector interface implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
flimzy committed Nov 23, 2023
1 parent d308d49 commit 744fbbc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ func drivers() []string {
return all
}

func TestShouldWorkWithOpenDB(t *testing.T) {
t.Parallel()
for _, d := range txDrivers {
db := sql.OpenDB(txdb.New(d.driver, d.dsn))
defer db.Close()
_, err := db.Exec("SELECT 1")
if err != nil {
t.Fatal(err)
}
}
}

func TestShouldRunWithNestedTransaction(t *testing.T) {
t.Parallel()
for _, driver := range drivers() {
Expand Down

0 comments on commit 744fbbc

Please sign in to comment.