Fix exceptions and incorrect results within the calculator plugin (#7438)

* remove functions which mages cannot interpret and add in functions which mages can

* set validResult when the result is explicitly created to differentiate it form an empty CalculateResult

* Add condition to check that the input is not ending with a binary operation

* add tests for all the cases

* use valid result while calculating hash as well

* add test for e is valid within regex

* removed i from regex

* remove valid result to use decimal? instead

* remove duplicate rand and exp
This commit is contained in:
Alekhya
2020-10-21 16:19:37 -07:00
committed by GitHub
parent 86d77103e9
commit dd2627dbbc
4 changed files with 83 additions and 24 deletions

View File

@@ -9,9 +9,9 @@ namespace Microsoft.Plugin.Calculator
{
public struct CalculateResult : IEquatable<CalculateResult>
{
public decimal Result { get; set; }
public decimal? Result { get; set; }
public decimal RoundedResult { get; set; }
public decimal? RoundedResult { get; set; }
public bool Equals(CalculateResult other)
{