diff --git a/http/request_parser_test.go b/http/request_parser_test.go index 249486ad..f3dfc6a6 100644 --- a/http/request_parser_test.go +++ b/http/request_parser_test.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "reflect" + "strconv" "testing" ) @@ -172,6 +173,12 @@ func Test_SingleParameterizedRequestNull(t *testing.T) { } func Test_SingleNamedParameterizedRequest(t *testing.T) { + if _, err := strconv.ParseInt(string("1.23"), 10, 64); err == nil { + // Just be sure that strconv.ParseInt fails on float, since + // the internal implementation of ParseRequest relies on it. + t.Fatal("strconv.ParseInt should fail on float") + } + s := "SELECT * FROM foo WHERE bar=:bar AND qux=:qux" b := []byte(fmt.Sprintf(`[["%s", %s]]`, s, mustJSONMarshal(map[string]interface{}{"bar": 3, "qux": "some string", "baz": 3.1457})))