2019-06-21 13:56:57 +02:00
|
|
|
package jet
|
2019-03-02 12:34:08 +01:00
|
|
|
|
2019-06-08 16:34:15 +02:00
|
|
|
import "testing"
|
2019-03-02 12:34:08 +01:00
|
|
|
|
2019-06-08 16:34:15 +02:00
|
|
|
func TestColumn(t *testing.T) {
|
2020-02-09 18:37:48 +01:00
|
|
|
column := NewColumnImpl("col", "", nil)
|
2019-12-01 18:25:30 +01:00
|
|
|
column.ExpressionInterfaceImpl.Parent = &column
|
2019-03-02 12:34:08 +01:00
|
|
|
|
2019-08-03 14:10:47 +02:00
|
|
|
assertClauseSerialize(t, column, "col")
|
2019-08-12 11:33:46 +02:00
|
|
|
column.setTableName("table1")
|
2019-08-03 14:10:47 +02:00
|
|
|
assertClauseSerialize(t, column, "table1.col")
|
2019-06-18 14:35:32 +02:00
|
|
|
assertProjectionSerialize(t, &column, `table1.col AS "table1.col"`)
|
2019-06-08 16:34:15 +02:00
|
|
|
assertProjectionSerialize(t, column.AS("alias1"), `table1.col AS "alias1"`)
|
2019-03-02 12:34:08 +01:00
|
|
|
}
|