15 lines
326 B
Go
15 lines
326 B
Go
package testutil
|
|
|
|
import (
|
|
"database/sql"
|
|
"testing"
|
|
)
|
|
|
|
// MustExec executes deterministic fixture SQL and fails the current test on error.
|
|
func MustExec(t *testing.T, db *sql.DB, statement string, args ...any) {
|
|
t.Helper()
|
|
if _, err := db.Exec(statement, args...); err != nil {
|
|
t.Fatalf("execute fixture: %v", err)
|
|
}
|
|
}
|