----------------------------------------------------------------------------- TestUnaryExpressionPosition verifies UnaryExpression nodes carry positions -----------------------------------------------------------------------------
(t *testing.T)
| 300 | // ----------------------------------------------------------------------------- |
| 301 | |
| 302 | func TestUnaryExpressionPosition(t *testing.T) { |
| 303 | tree := parseWithPositions(t, "SELECT * FROM users WHERE NOT active") |
| 304 | |
| 305 | sel := tree.Statements[0].(*ast.SelectStatement) |
| 306 | if sel.Where == nil { |
| 307 | t.Fatal("expected WHERE clause") |
| 308 | } |
| 309 | |
| 310 | unary, ok := sel.Where.(*ast.UnaryExpression) |
| 311 | if !ok { |
| 312 | t.Fatalf("expected *ast.UnaryExpression, got %T", sel.Where) |
| 313 | } |
| 314 | |
| 315 | assertPos(t, "UnaryExpression(NOT).Pos", unary.Pos) |
| 316 | } |
| 317 | |
| 318 | // ----------------------------------------------------------------------------- |
| 319 | // TestJoinClausePosition verifies JoinClause nodes carry positions |
nothing calls this directly
no test coverage detected