mirror of
https://github.com/jackc/pgx.git
synced 2025-05-22 07:20:35 +00:00
Start factoring test helpers out
This commit is contained in:
parent
26105f4409
commit
8afcde41f2
@ -15,12 +15,6 @@ var float4TextVsBinaryTestDataLoaded bool
|
||||
var float8TextVsBinaryTestDataLoaded 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) {
|
||||
if narrowTestDataLoaded {
|
||||
return
|
||||
|
11
helper_test.go
Normal file
11
helper_test.go
Normal file
@ -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…
x
Reference in New Issue
Block a user