|
|
@ -4,6 +4,7 @@ import (
|
|
|
|
"encoding/json"
|
|
|
|
"encoding/json"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"reflect"
|
|
|
|
"reflect"
|
|
|
|
|
|
|
|
"strconv"
|
|
|
|
"testing"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
@ -172,6 +173,12 @@ func Test_SingleParameterizedRequestNull(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func Test_SingleNamedParameterizedRequest(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"
|
|
|
|
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})))
|
|
|
|
b := []byte(fmt.Sprintf(`[["%s", %s]]`, s, mustJSONMarshal(map[string]interface{}{"bar": 3, "qux": "some string", "baz": 3.1457})))
|
|
|
|
|
|
|
|
|
|
|
|