(t *testing.T)
| 19 | ) |
| 20 | |
| 21 | func TestInterpolateParams(t *testing.T) { |
| 22 | mc := &mysqlConn{ |
| 23 | buf: newBuffer(), |
| 24 | maxAllowedPacket: maxPacketSize, |
| 25 | cfg: &Config{ |
| 26 | InterpolateParams: true, |
| 27 | }, |
| 28 | } |
| 29 | |
| 30 | q, err := mc.interpolateParams("SELECT ?+?", []driver.Value{int64(42), "gopher"}) |
| 31 | if err != nil { |
| 32 | t.Errorf("Expected err=nil, got %#v", err) |
| 33 | return |
| 34 | } |
| 35 | expected := `SELECT 42+'gopher'` |
| 36 | if q != expected { |
| 37 | t.Errorf("Expected: %q\nGot: %q", expected, q) |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | func TestInterpolateParamsJSONRawMessage(t *testing.T) { |
| 42 | mc := &mysqlConn{ |
nothing calls this directly
no test coverage detected