jet/column_test.go

15 lines
432 B
Go
Raw Normal View History

2019-06-21 13:56:57 +02:00
package jet
2019-06-08 16:34:15 +02:00
import "testing"
2019-06-08 16:34:15 +02:00
func TestColumn(t *testing.T) {
column := newColumn("col", "", nil)
column.expressionInterfaceImpl.parent = &column
2019-07-31 18:43:54 +02:00
AssertPostgreClauseSerialize(t, column, "col")
2019-06-08 16:34:15 +02:00
column.setTableName("table1")
2019-07-31 18:43:54 +02:00
AssertPostgreClauseSerialize(t, column, "table1.col")
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"`)
}