tests that sqlx will not panic when the wrong driver is passed because of an automatic nil dereference in sqlx.Open(), which was fixed.
(t *testing.T)
| 1306 | // tests that sqlx will not panic when the wrong driver is passed because |
| 1307 | // of an automatic nil dereference in sqlx.Open(), which was fixed. |
| 1308 | func TestDoNotPanicOnConnect(t *testing.T) { |
| 1309 | db, err := Connect("bogus", "hehe") |
| 1310 | if err == nil { |
| 1311 | t.Errorf("Should return error when using bogus driverName") |
| 1312 | } |
| 1313 | if db != nil { |
| 1314 | t.Errorf("Should not return the db on a connect failure") |
| 1315 | } |
| 1316 | } |
| 1317 | |
| 1318 | func TestRebind(t *testing.T) { |
| 1319 | q1 := `INSERT INTO foo (a, b, c, d, e, f, g, h, i) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` |