2019-05-29 14:03:38 +02:00
|
|
|
package sqlbuilder
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"gotest.tools/assert"
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
2019-05-31 12:59:57 +02:00
|
|
|
func TestFloatExpressionEQColumn(t *testing.T) {
|
2019-05-31 14:37:51 +02:00
|
|
|
assert.Equal(t, getTestSerialize(t, table1Col1.EQ(table2Col3)), "(table1.col1 = table2.col3)")
|
2019-05-29 14:03:38 +02:00
|
|
|
}
|
|
|
|
|
|
2019-05-31 12:59:57 +02:00
|
|
|
func TestFloatExpressionEQInt(t *testing.T) {
|
2019-05-31 14:37:51 +02:00
|
|
|
assert.Equal(t, getTestSerialize(t, table1Col1.EQ(Int(11))), "(table1.col1 = $1)")
|
2019-05-29 14:03:38 +02:00
|
|
|
}
|
|
|
|
|
|
2019-05-31 12:59:57 +02:00
|
|
|
func TestFloatExpressionEQFloat(t *testing.T) {
|
2019-05-31 14:37:51 +02:00
|
|
|
assert.Equal(t, getTestSerialize(t, table1Col1.EQ(Int(22))), "(table1.col1 = $1)")
|
2019-05-29 14:03:38 +02:00
|
|
|
}
|
|
|
|
|
|
2019-05-31 12:59:57 +02:00
|
|
|
func TestFloatExpressionNOT_EQ(t *testing.T) {
|
2019-05-31 14:37:51 +02:00
|
|
|
assert.Equal(t, getTestSerialize(t, table1Col1.NOT_EQ(table2Col3)), "(table1.col1 != table2.col3)")
|
2019-05-29 14:03:38 +02:00
|
|
|
}
|
|
|
|
|
|
2019-05-31 12:59:57 +02:00
|
|
|
func TestFloatExpressionGT(t *testing.T) {
|
2019-05-31 14:37:51 +02:00
|
|
|
assert.Equal(t, getTestSerialize(t, table1Col1.GT(table2Col3)), "(table1.col1 > table2.col3)")
|
2019-05-29 14:03:38 +02:00
|
|
|
}
|
|
|
|
|
|
2019-05-31 12:59:57 +02:00
|
|
|
func TestFloatExpressionGT_EQ(t *testing.T) {
|
2019-05-31 14:37:51 +02:00
|
|
|
assert.Equal(t, getTestSerialize(t, table1Col1.GT_EQ(table2Col3)), "(table1.col1 >= table2.col3)")
|
2019-05-29 14:03:38 +02:00
|
|
|
}
|
|
|
|
|
|
2019-05-31 12:59:57 +02:00
|
|
|
func TestFloatExpressionLT(t *testing.T) {
|
2019-05-31 14:37:51 +02:00
|
|
|
assert.Equal(t, getTestSerialize(t, table1Col1.LT(table2Col3)), "(table1.col1 < table2.col3)")
|
2019-05-29 14:03:38 +02:00
|
|
|
}
|
|
|
|
|
|
2019-05-31 12:59:57 +02:00
|
|
|
func TestFloatExpressionLT_EQ(t *testing.T) {
|
2019-05-31 14:37:51 +02:00
|
|
|
assert.Equal(t, getTestSerialize(t, table1Col1.LT_EQ(table2Col3)), "(table1.col1 <= table2.col3)")
|
2019-05-29 14:03:38 +02:00
|
|
|
}
|