jet/column_test.go

15 lines
418 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-06-08 16:34:15 +02:00
assertClauseSerialize(t, column, "col")
column.setTableName("table1")
assertClauseSerialize(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"`)
}