Skip to content

Commit

Permalink
Map <> (order matters)
Browse files Browse the repository at this point in the history
  • Loading branch information
datchung committed May 27, 2020
1 parent ace06e5 commit 7461f2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ ExpressionEvaluator.SetOperatorMap(new Dictionary<string, string>
{
{"and", "&&"},
{"or", "||"},
{"not", "!" },
{"<>", "!=" },
{"not", "!" },
{"true", "1" },
{"false", "0" }
});
Expand Down
3 changes: 2 additions & 1 deletion src/ExpressionEvaluator.Test/ExpressionEvaluatorTEst.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public void Evaluate_Double(string expression, double expectedResult)
[TestCase("0 && !1", false, "false and not true")]
[TestCase("(!0 && 1) || 1", true, "( not false and true ) or true ")]
[TestCase("(!0 && 1) || 1", false, "( not false and true ) or true")]
[TestCase("(!0 != 1) || 1", true, "( not false <> true ) or true ")]
[TestCase("!0", false, "not false")]
[TestCase(" !0", false, "not false")]
[TestCase("!0 ", false, "not false")]
Expand All @@ -63,8 +64,8 @@ public void ReplaceOperators(string expression, bool allowExtraSpaces, string ex
{
{"and", "&&"},
{"or", "||"},
{"not", "!" },
{"<>", "!=" },
{"not", "!" },
{"true", "1" },
{"false", "0" }
});
Expand Down

0 comments on commit 7461f2b

Please sign in to comment.