(t *testing.T)
| 274 | } |
| 275 | |
| 276 | func TestExtractExpression_SQL(t *testing.T) { |
| 277 | e := &ExtractExpression{Field: "YEAR", Source: &Identifier{Name: "created_at"}} |
| 278 | if !strings.Contains(e.SQL(), "EXTRACT(YEAR FROM created_at)") { |
| 279 | t.Errorf("got: %s", e.SQL()) |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | func TestPositionExpression_SQL(t *testing.T) { |
| 284 | p := &PositionExpression{Substr: &LiteralValue{Value: "'x'"}, Str: &Identifier{Name: "name"}} |