Add unit test for change made by PR 1273

pull/1282/head
Philip O'Toole 2014-12-31 15:50:10 -08:00
parent ff4ec329a8
commit f37f0b80fa
1 changed files with 14 additions and 0 deletions

View File

@ -407,6 +407,20 @@ func TestParser_ParseExpr(t *testing.T) {
},
},
// Binary expression with no precedence, tests left associativity.
{
s: `1 * 2 * 3`,
expr: &influxql.BinaryExpr{
Op: influxql.MUL,
LHS: &influxql.BinaryExpr{
Op: influxql.MUL,
LHS: &influxql.NumberLiteral{Val: 1},
RHS: &influxql.NumberLiteral{Val: 2},
},
RHS: &influxql.NumberLiteral{Val: 3},
},
},
// Complex binary expression.
{
s: `value + 3 < 30 AND 1 + 2 OR true`,