Skip to content

Commit

Permalink
#6027: More test cases to cover logical operator precedence
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Jul 29, 2022
1 parent 9aa457c commit bf24ebb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/Materials.cpp
Expand Up @@ -1573,7 +1573,10 @@ TEST_F(MaterialsTest, ShaderExpressionEvaluation)
{ "(time / 6) * 3", (TimeInSeconds / 6.0f) * 3.0f },
{ "9 - 5 + 2", 6.0f },
{ "9 - 5 - 2", 2.0f },

{ "0 && 1 || 1", 1.0f },
{ "1 || 1 && 0", 1.0f },
{ "0 <= 1 <= 0", 0.0f },
{ "5 >= 7 == 7 >= 9", 1.0f },
};

for (const auto& [expressionString, expectedValue] : testExpressions)
Expand Down

0 comments on commit bf24ebb

Please sign in to comment.