File size: 319 Bytes
d6f631f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | package clickhouse
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_ValidateJsonPathQuery(t *testing.T) {
query, args := validateJsonPathQuery{
jsonPath: "$.foo.bar",
}.toSQL()
assert.Equal(t, `SELECT JSON_VALUE('{}', ?)`, query)
assert.Equal(t, []interface{}{
"$.foo.bar",
}, args)
}
|