(ctx context.Context, schema Schema, t *testing.T, test func(ctx context.Context, db *DB, t *testing.T))
| 43 | } |
| 44 | |
| 45 | func RunWithSchemaContext(ctx context.Context, schema Schema, t *testing.T, test func(ctx context.Context, db *DB, t *testing.T)) { |
| 46 | runner := func(ctx context.Context, db *DB, t *testing.T, create, drop, now string) { |
| 47 | defer func() { |
| 48 | MultiExecContext(ctx, db, drop) |
| 49 | }() |
| 50 | |
| 51 | MultiExecContext(ctx, db, create) |
| 52 | test(ctx, db, t) |
| 53 | } |
| 54 | |
| 55 | if TestPostgres { |
| 56 | create, drop, now := schema.Postgres() |
| 57 | runner(ctx, pgdb, t, create, drop, now) |
| 58 | } |
| 59 | if TestSqlite { |
| 60 | create, drop, now := schema.Sqlite3() |
| 61 | runner(ctx, sldb, t, create, drop, now) |
| 62 | } |
| 63 | if TestMysql { |
| 64 | create, drop, now := schema.MySQL() |
| 65 | runner(ctx, mysqldb, t, create, drop, now) |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | func loadDefaultFixtureContext(ctx context.Context, db *DB, t *testing.T) { |
| 70 | tx := db.MustBeginTx(ctx, nil) |
no test coverage detected