mirror of https://github.com/jackc/pgx.git
Start factoring test helpers out
parent
26105f4409
commit
8afcde41f2
|
@ -15,12 +15,6 @@ var float4TextVsBinaryTestDataLoaded bool
|
||||||
var float8TextVsBinaryTestDataLoaded bool
|
var float8TextVsBinaryTestDataLoaded bool
|
||||||
var boolTextVsBinaryTestDataLoaded bool
|
var boolTextVsBinaryTestDataLoaded bool
|
||||||
|
|
||||||
func mustPrepare(b *testing.B, conn *Connection, name, sql string) {
|
|
||||||
if err := conn.Prepare(name, sql); err != nil {
|
|
||||||
b.Fatalf("Could not prepare %v: %v", name, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func createNarrowTestData(b *testing.B, conn *Connection) {
|
func createNarrowTestData(b *testing.B, conn *Connection) {
|
||||||
if narrowTestDataLoaded {
|
if narrowTestDataLoaded {
|
||||||
return
|
return
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
package pgx
|
||||||
|
|
||||||
|
type test interface {
|
||||||
|
Fatalf(format string, args ...interface{})
|
||||||
|
}
|
||||||
|
|
||||||
|
func mustPrepare(t test, conn *Connection, name, sql string) {
|
||||||
|
if err := conn.Prepare(name, sql); err != nil {
|
||||||
|
t.Fatalf("Could not prepare %v: %v", name, err)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue