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

Function TestExpressionNodeMarkers

pkg/sql/ast/interface_test.go:60–112  ·  view source on GitHub ↗

TestExpressionNodeMarkers tests all expressionNode() marker methods

(t *testing.T)

Source from the content-addressed store, hash-verified

58
59// TestExpressionNodeMarkers tests all expressionNode() marker methods
60func TestExpressionNodeMarkers(t *testing.T) {
61 tests := []struct {
62 name string
63 expr Expression
64 }{
65 {"JoinClause", &JoinClause{}},
66 {"OrderByExpression", &OrderByExpression{}},
67 {"WindowFrameBound", &WindowFrameBound{}},
68 {"FetchClause", &FetchClause{}},
69 {"RollupExpression", &RollupExpression{}},
70 {"CubeExpression", &CubeExpression{}},
71 {"GroupingSetsExpression", &GroupingSetsExpression{}},
72 {"Identifier", &Identifier{}},
73 {"FunctionCall", &FunctionCall{}},
74 {"CaseExpression", &CaseExpression{}},
75 {"WhenClause", &WhenClause{}},
76 {"ExistsExpression", &ExistsExpression{}},
77 {"InExpression", &InExpression{}},
78 {"SubqueryExpression", &SubqueryExpression{}},
79 {"AnyExpression", &AnyExpression{}},
80 {"AllExpression", &AllExpression{}},
81 {"BetweenExpression", &BetweenExpression{}},
82 {"BinaryExpression", &BinaryExpression{}},
83 {"LiteralValue", &LiteralValue{}},
84 {"ListExpression", &ListExpression{}},
85 {"UnaryExpression", &UnaryExpression{}},
86 {"CastExpression", &CastExpression{}},
87 {"ExtractExpression", &ExtractExpression{}},
88 {"PositionExpression", &PositionExpression{}},
89 {"SubstringExpression", &SubstringExpression{}},
90 {"OnConflict", &OnConflict{}},
91 {"UpsertClause", &UpsertClause{}},
92 {"ColumnDef", &ColumnDef{}},
93 {"ColumnConstraint", &ColumnConstraint{}},
94 {"TableConstraint", &TableConstraint{}},
95 {"ReferenceDefinition", &ReferenceDefinition{}},
96 {"PartitionBy", &PartitionBy{}},
97 {"TableOption", &TableOption{}},
98 {"UpdateExpression", &UpdateExpression{}},
99 {"AlterTableAction", &AlterTableAction{}},
100 {"IndexColumn", &IndexColumn{}},
101 {"MergeWhenClause", &MergeWhenClause{}},
102 {"MergeAction", &MergeAction{}},
103 {"SetClause", &SetClause{}},
104 {"PartitionDefinition", &PartitionDefinition{}},
105 }
106
107 for _, tt := range tests {
108 t.Run(tt.name, func(t *testing.T) {
109 tt.expr.expressionNode()
110 })
111 }
112}
113
114// TestTokenLiteralMethods tests TokenLiteral() for all node types
115func TestTokenLiteralMethods(t *testing.T) {

Callers

nothing calls this directly

Calls 2

RunMethod · 0.80
expressionNodeMethod · 0.65

Tested by

no test coverage detected