MCPcopy
hub / github.com/go-sql-driver/mysql / runTestsWithMultiStatement

Function runTestsWithMultiStatement

driver_test.go:120–142  ·  driver_test.go::runTestsWithMultiStatement
(t *testing.T, dsn string, tests ...func(dbt *DBTest))

Source from the content-addressed store, hash-verified

118}
119
120func runTestsWithMultiStatement(t *testing.T, dsn string, tests ...func(dbt *DBTest)) {
121 if !available {
122 t.Skipf("MySQL server not running on %s", netAddr)
123 }
124
125 dsn += "&multiStatements=true"
126 var db *sql.DB
127 if _, err := ParseDSN(dsn); err != errInvalidDSNUnsafeCollation {
128 db, err = sql.Open(driverNameTest, dsn)
129 if err != nil {
130 t.Fatalf("error connecting: %s", err.Error())
131 }
132 defer db.Close()
133 }
134 // Previous test may be skipped without dropping the test table
135 db.Exec("DROP TABLE IF EXISTS test")
136
137 dbt := &DBTest{t, db}
138 for _, test := range tests {
139 test(dbt)
140 dbt.db.Exec("DROP TABLE IF EXISTS test")
141 }
142}
143
144func runTests(t *testing.T, dsn string, tests ...func(dbt *DBTest)) {
145 if !available {

Callers 6

TestMultiQueryFunction · 0.85
TestInterruptBySignalFunction · 0.85
TestMultiResultSetFunction · 0.85
TestExecMultipleResultsFunction · 0.85
TestQueryMultipleResultsFunction · 0.85

Calls 5

ParseDSNFunction · 0.85
OpenMethod · 0.80
ErrorMethod · 0.45
CloseMethod · 0.45
ExecMethod · 0.45

Tested by

no test coverage detected