material_manage_system/internal/testutil/fixtures.go
2026-09-15 16:08:18 +08:00

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)
}
}