jet/internal/jet/column_test.go

15 lines
422 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 := NewColumnImpl("col", "", nil)
column.ExpressionInterfaceImpl.Parent = &column
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")
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"`)
}