MCPcopy Index your code
hub / github.com/bytebase/bytebase / TestOracleOmniASTWrapper

Function TestOracleOmniASTWrapper

backend/plugin/parser/plsql/omni_test.go:157–176  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

155}
156
157func TestOracleOmniASTWrapper(t *testing.T) {
158 node := &ast.SelectStmt{}
159 start := &storepb.Position{Line: 2, Column: 3}
160 omniAST := &OmniAST{
161 Node: node,
162 Text: "SELECT 1 FROM DUAL",
163 StartPosition: start,
164 }
165
166 var parsed base.AST = omniAST
167 require.Equal(t, start, parsed.ASTStartPosition())
168
169 got, ok := GetOmniNode(parsed)
170 require.True(t, ok)
171 require.Same(t, node, got)
172
173 got, ok = GetOmniNode(nil)
174 require.False(t, ok)
175 require.Nil(t, got)
176}
177
178func TestOracleOmniASTUsesOmniNode(t *testing.T) {
179 start := &storepb.Position{Line: 4, Column: 1}

Callers

nothing calls this directly

Calls 3

ASTStartPositionMethod · 0.95
GetOmniNodeFunction · 0.70
EqualMethod · 0.65

Tested by

no test coverage detected