MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestArrayConstructorExpression_SQL

Function TestArrayConstructorExpression_SQL

pkg/sql/ast/sql_coverage_test.go:317–328  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

315}
316
317func TestArrayConstructorExpression_SQL(t *testing.T) {
318 // With elements
319 a := &ArrayConstructorExpression{Elements: []Expression{&LiteralValue{Value: "1"}, &LiteralValue{Value: "2"}}}
320 if a.SQL() != "ARRAY[1, 2]" {
321 t.Errorf("got: %s", a.SQL())
322 }
323 // With subquery
324 a2 := &ArrayConstructorExpression{Subquery: &SelectStatement{Columns: []Expression{&Identifier{Name: "x"}}}}
325 if !strings.Contains(a2.SQL(), "ARRAY(") {
326 t.Errorf("got: %s", a2.SQL())
327 }
328}
329
330func TestArraySubscriptExpression_SQL(t *testing.T) {
331 a := &ArraySubscriptExpression{

Callers

nothing calls this directly

Calls 2

SQLMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected