2019-07-07 12:19:05 +02:00
|
|
|
package jet
|
|
|
|
|
|
2019-08-11 14:29:03 +02:00
|
|
|
import (
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestCastAS(t *testing.T) {
|
|
|
|
|
assertClauseSerialize(t, NewCastImpl(Int(1)).AS("boolean"), "CAST($1 AS boolean)", int64(1))
|
|
|
|
|
assertClauseSerialize(t, NewCastImpl(table2Col3).AS("real"), "CAST(table2.col3 AS real)")
|
|
|
|
|
assertClauseSerialize(t, NewCastImpl(table2Col3.ADD(table2Col3)).AS("integer"), "CAST((table2.col3 + table2.col3) AS integer)")
|
|
|
|
|
}
|