Support for additional mathematical functions.
This commit is contained in:
parent
cf022ab68d
commit
52bdd4b59f
14 changed files with 436 additions and 79 deletions
|
|
@ -6,33 +6,53 @@ import (
|
|||
)
|
||||
|
||||
func TestFloatExpressionEQColumn(t *testing.T) {
|
||||
assert.Equal(t, getTestSerialize(t, table1Col1.EQ(table2Col3)), "(table1.col1 = table2.col3)")
|
||||
}
|
||||
|
||||
func TestFloatExpressionEQInt(t *testing.T) {
|
||||
assert.Equal(t, getTestSerialize(t, table1Col1.EQ(Int(11))), "(table1.col1 = $1)")
|
||||
assert.Equal(t, getTestSerialize(t, table1ColFloat.EQ(table2ColFloat)), "(table1.colFloat = table2.colFloat)")
|
||||
}
|
||||
|
||||
func TestFloatExpressionEQFloat(t *testing.T) {
|
||||
assert.Equal(t, getTestSerialize(t, table1Col1.EQ(Int(22))), "(table1.col1 = $1)")
|
||||
assert.Equal(t, getTestSerialize(t, table1ColFloat.EQ(Float(11))), "(table1.colFloat = $1)")
|
||||
}
|
||||
|
||||
func TestFloatExpressionNOT_EQ(t *testing.T) {
|
||||
assert.Equal(t, getTestSerialize(t, table1Col1.NOT_EQ(table2Col3)), "(table1.col1 != table2.col3)")
|
||||
assert.Equal(t, getTestSerialize(t, table1ColFloat.NOT_EQ(table2ColFloat)), "(table1.colFloat != table2.colFloat)")
|
||||
}
|
||||
|
||||
func TestFloatExpressionGT(t *testing.T) {
|
||||
assert.Equal(t, getTestSerialize(t, table1Col1.GT(table2Col3)), "(table1.col1 > table2.col3)")
|
||||
assert.Equal(t, getTestSerialize(t, table1ColFloat.GT(table2ColFloat)), "(table1.colFloat > table2.colFloat)")
|
||||
}
|
||||
|
||||
func TestFloatExpressionGT_EQ(t *testing.T) {
|
||||
assert.Equal(t, getTestSerialize(t, table1Col1.GT_EQ(table2Col3)), "(table1.col1 >= table2.col3)")
|
||||
assert.Equal(t, getTestSerialize(t, table1ColFloat.GT_EQ(table2ColFloat)), "(table1.colFloat >= table2.colFloat)")
|
||||
}
|
||||
|
||||
func TestFloatExpressionLT(t *testing.T) {
|
||||
assert.Equal(t, getTestSerialize(t, table1Col1.LT(table2Col3)), "(table1.col1 < table2.col3)")
|
||||
assert.Equal(t, getTestSerialize(t, table1ColFloat.LT(table2ColFloat)), "(table1.colFloat < table2.colFloat)")
|
||||
}
|
||||
|
||||
func TestFloatExpressionLT_EQ(t *testing.T) {
|
||||
assert.Equal(t, getTestSerialize(t, table1Col1.LT_EQ(table2Col3)), "(table1.col1 <= table2.col3)")
|
||||
assert.Equal(t, getTestSerialize(t, table1ColFloat.LT_EQ(table2ColFloat)), "(table1.colFloat <= table2.colFloat)")
|
||||
}
|
||||
|
||||
func TestFloatExpressionADD(t *testing.T) {
|
||||
assert.Equal(t, getTestSerialize(t, table1ColFloat.ADD(table2ColFloat)), "(table1.colFloat + table2.colFloat)")
|
||||
}
|
||||
|
||||
func TestFloatExpressionSUB(t *testing.T) {
|
||||
assert.Equal(t, getTestSerialize(t, table1ColFloat.SUB(table2ColFloat)), "(table1.colFloat - table2.colFloat)")
|
||||
}
|
||||
|
||||
func TestFloatExpressionMUL(t *testing.T) {
|
||||
assert.Equal(t, getTestSerialize(t, table1ColFloat.MUL(table2ColFloat)), "(table1.colFloat * table2.colFloat)")
|
||||
}
|
||||
|
||||
func TestFloatExpressionDIV(t *testing.T) {
|
||||
assert.Equal(t, getTestSerialize(t, table1ColFloat.DIV(table2ColFloat)), "(table1.colFloat / table2.colFloat)")
|
||||
}
|
||||
|
||||
func TestFloatExpressionMOD(t *testing.T) {
|
||||
assert.Equal(t, getTestSerialize(t, table1ColFloat.MOD(table2ColFloat)), "(table1.colFloat % table2.colFloat)")
|
||||
}
|
||||
|
||||
func TestFloatExpressionEXP(t *testing.T) {
|
||||
assert.Equal(t, getTestSerialize(t, table1ColFloat.POW(table2ColFloat)), "(table1.colFloat ^ table2.colFloat)")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue