@ -85,23 +85,20 @@ var testExpr = []struct {
input : "1 / 1" ,
input : "1 / 1" ,
expected : & BinaryExpr { itemDIV , & NumberLiteral { 1 } , & NumberLiteral { 1 } , nil , false } ,
expected : & BinaryExpr { itemDIV , & NumberLiteral { 1 } , & NumberLiteral { 1 } , nil , false } ,
} , {
} , {
input : "1 == 1" ,
input : "1 == bool 1" ,
expected : & BinaryExpr { itemEQL , & NumberLiteral { 1 } , & NumberLiteral { 1 } , nil , false } ,
expected : & BinaryExpr { itemEQL , & NumberLiteral { 1 } , & NumberLiteral { 1 } , nil , true } ,
} , {
input : "1 != 1" ,
expected : & BinaryExpr { itemNEQ , & NumberLiteral { 1 } , & NumberLiteral { 1 } , nil , false } ,
} , {
} , {
input : "1 > 1",
input : "1 != bool 1" ,
expected : & BinaryExpr { item GTR , & NumberLiteral { 1 } , & NumberLiteral { 1 } , nil , fals e} ,
expected : & BinaryExpr { itemNEQ , & NumberLiteral { 1 } , & NumberLiteral { 1 } , nil , true } ,
} , {
} , {
input : "1 > = 1",
input : "1 > bool 1",
expected : & BinaryExpr { itemGT E , & NumberLiteral { 1 } , & NumberLiteral { 1 } , nil , fals e} ,
expected : & BinaryExpr { itemGT R , & NumberLiteral { 1 } , & NumberLiteral { 1 } , nil , tru e} ,
} , {
} , {
input : "1 < 1",
input : "1 >= bool 1",
expected : & BinaryExpr { item LSS , & NumberLiteral { 1 } , & NumberLiteral { 1 } , nil , fals e} ,
expected : & BinaryExpr { item GTE , & NumberLiteral { 1 } , & NumberLiteral { 1 } , nil , tru e} ,
} , {
} , {
input : "1 < = 1",
input : "1 < bool 1",
expected : & BinaryExpr { itemL TE , & NumberLiteral { 1 } , & NumberLiteral { 1 } , nil , fals e} ,
expected : & BinaryExpr { itemL SS , & NumberLiteral { 1 } , & NumberLiteral { 1 } , nil , tru e} ,
} , {
} , {
input : "1 <= bool 1" ,
input : "1 <= bool 1" ,
expected : & BinaryExpr { itemLTE , & NumberLiteral { 1 } , & NumberLiteral { 1 } , nil , true } ,
expected : & BinaryExpr { itemLTE , & NumberLiteral { 1 } , & NumberLiteral { 1 } , nil , true } ,
@ -203,6 +200,10 @@ var testExpr = []struct {
input : "1 and 1" ,
input : "1 and 1" ,
fail : true ,
fail : true ,
errMsg : "AND and OR not allowed in binary scalar expression" ,
errMsg : "AND and OR not allowed in binary scalar expression" ,
} , {
input : "1 == 1" ,
fail : true ,
errMsg : "parse error at char 7: comparisons between scalars must use BOOL modifier" ,
} , {
} , {
input : "1 or 1" ,
input : "1 or 1" ,
fail : true ,
fail : true ,