MCPcopy Create free account
hub / github.com/araddon/qlbridge / compareAst

Function compareAst

rel/sql_test.go:118–135  ·  view source on GitHub ↗
(t *testing.T, in1, in2 rel.SqlStatement)

Source from the content-addressed store, hash-verified

116}
117
118func compareAst(t *testing.T, in1, in2 rel.SqlStatement) {
119 switch s1 := in1.(type) {
120 case *rel.SqlSelect:
121 s2, ok := in2.(*rel.SqlSelect)
122 assert.True(t, ok, "Must also be SqlSelect")
123 u.Debugf("original:\n%s", s1.String())
124 u.Debugf("after:\n%s", s2.String())
125 //assert.True(t, s1.Alias == s2.Alias)
126 //assert.True(t, len(s1.Columns) == len(s2.Columns))
127 for i, c := range s1.Columns {
128 compareAstColumn(t, c, s2.Columns[i])
129 }
130 //compareWhere(s1.Where)
131 compareFroms(t, s1.From, s2.From)
132 default:
133 t.Fatalf("Must be SqlSelect")
134 }
135}
136
137func compareNode(t *testing.T, n1, n2 expr.Node) {
138 if n1 == nil && n2 == nil {

Callers 1

TestToSqlFunction · 0.85

Calls 3

compareAstColumnFunction · 0.85
compareFromsFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected