From 8afcde41f23628a83bc41680c1d8aef51a852883 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 13 Jul 2013 17:29:24 -0400 Subject: [PATCH] Start factoring test helpers out --- bench_test.go | 6 ------ helper_test.go | 11 +++++++++++ 2 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 helper_test.go diff --git a/bench_test.go b/bench_test.go index 35192315..c5418fbb 100644 --- a/bench_test.go +++ b/bench_test.go @@ -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 diff --git a/helper_test.go b/helper_test.go new file mode 100644 index 00000000..bc2eb945 --- /dev/null +++ b/helper_test.go @@ -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) + } +}