Skip to content

Commit

Permalink
Added tests for issue #8, whereby logical operators with expressions …
Browse files Browse the repository at this point in the history
…on either side seem to result in opposite-intended results
  • Loading branch information
Knetic committed Mar 27, 2016
1 parent 39e44fb commit 3bf4c42
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions evaluation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,38 @@ func TestParameterizedEvaluation(test *testing.T) {
Input: "(2 + 2) >= 4",
Expected: true,
},
EvaluationTest{

Name: "Two-boolean logical operation (for issue #8)",
Input: "foo == true || bar == true",
Parameters: []EvaluationParameter{
EvaluationParameter{
Name: "foo",
Value: true,
},
EvaluationParameter{
Name: "bar",
Value: false,
},
},
Expected: true,
},
EvaluationTest{

Name: "Two-variable integer logical operation (for issue #8)",
Input: "foo > 10 && bar > 10",
Parameters: []EvaluationParameter{
EvaluationParameter{
Name: "foo",
Value: 1,
},
EvaluationParameter{
Name: "bar",
Value: 11,
},
},
Expected: false,
},
}

runEvaluationTests(evaluationTests, test)
Expand Down

0 comments on commit 3bf4c42

Please sign in to comment.