@@ -1022,6 +1022,7 @@ public static IEnumerable<TestCaseData> TestCasesForWithCustomVariablesExpressio
1022
1022
Dictionary < string , object > variablesForSimpleVariablesInjection = new Dictionary < string , object > ( )
1023
1023
{
1024
1024
{ "hello" , "Test" } ,
1025
+ { "a" , 0 } ,
1025
1026
{ "x" , 5 } ,
1026
1027
{ "y" , 20 } ,
1027
1028
{ "isThisReal" , true } ,
@@ -1056,6 +1057,10 @@ public static IEnumerable<TestCaseData> TestCasesForWithCustomVariablesExpressio
1056
1057
yield return new TestCaseData ( "-x + +y" , variablesForSimpleVariablesInjection , true ) . SetCategory ( "SimpleVariablesInjection,Unary both +-" ) . Returns ( 15 ) ;
1057
1058
yield return new TestCaseData ( "(-x + +y)" , variablesForSimpleVariablesInjection , true ) . SetCategory ( "SimpleVariablesInjection,Unary both +-,Parenthis" ) . Returns ( 15 ) ;
1058
1059
1060
+ yield return new TestCaseData ( "-~a" , variablesForSimpleVariablesInjection , true ) . SetCategory ( "SimpleVariablesInjection,MultipleUnary" ) . Returns ( 1 ) ;
1061
+ yield return new TestCaseData ( "+-+-+-+-+a" , variablesForSimpleVariablesInjection , true ) . SetCategory ( "SimpleVariablesInjection,MultipleUnary" ) . Returns ( 0 ) ;
1062
+ yield return new TestCaseData ( "a >> +-+-+-+2 << +-+-+-+-2 >> +-+-+-+-+2 << +-+-+-+-+2" , variablesForSimpleVariablesInjection , true ) . SetCategory ( "SimpleVariablesInjection,MultipleUnary" ) . Returns ( 0 ) ;
1063
+
1059
1064
yield return new TestCaseData ( "ISTHISREAL" , variablesForSimpleVariablesInjection , false ) . SetCategory ( "SimpleVariablesInjection,IgnoreCase" ) . Returns ( true ) . SetCategory ( "Options, OptionCaseSensitiveEvaluationActive" ) ;
1060
1065
yield return new TestCaseData ( "isthisreal" , variablesForSimpleVariablesInjection , false ) . SetCategory ( "SimpleVariablesInjection,IgnoreCase" ) . Returns ( true ) . SetCategory ( "Options, OptionCaseSensitiveEvaluationActive" ) ;
1061
1066
yield return new TestCaseData ( "iStHISrEAL" , variablesForSimpleVariablesInjection , false ) . SetCategory ( "SimpleVariablesInjection,IgnoreCase" ) . Returns ( true ) . SetCategory ( "Options, OptionCaseSensitiveEvaluationActive" ) ;
@@ -2146,6 +2151,55 @@ void Evaluator_PreEvaluateVariable(object sender, VariablePreEvaluationEventArg
2146
2151
. SetCategory ( "inherits ExpressionEvaluator" )
2147
2152
. SetCategory ( "Custom operators" ) ;
2148
2153
2154
+ yield return new TestCaseData ( xExpressionEvaluator2
2155
+ , "2##" , null )
2156
+ . Returns ( 1.4142135623730952d )
2157
+ . SetCategory ( "ExpressionEvaluator extend" )
2158
+ . SetCategory ( "inherits ExpressionEvaluator" )
2159
+ . SetCategory ( "Custom operators" ) ;
2160
+
2161
+ yield return new TestCaseData ( xExpressionEvaluator2
2162
+ , "2## + 1" , null )
2163
+ . Returns ( 2.4142135623730949d )
2164
+ . SetCategory ( "ExpressionEvaluator extend" )
2165
+ . SetCategory ( "inherits ExpressionEvaluator" )
2166
+ . SetCategory ( "Custom operators" ) ;
2167
+
2168
+ yield return new TestCaseData ( xExpressionEvaluator2
2169
+ , "2## + +-+-~+1" , null )
2170
+ . Returns ( - 0.58578643762690485d )
2171
+ . SetCategory ( "ExpressionEvaluator extend" )
2172
+ . SetCategory ( "inherits ExpressionEvaluator" )
2173
+ . SetCategory ( "Custom operators" ) ;
2174
+
2175
+ yield return new TestCaseData ( xExpressionEvaluator2
2176
+ , "2#°" , null )
2177
+ . Returns ( 0.70710678118654757d )
2178
+ . SetCategory ( "ExpressionEvaluator extend" )
2179
+ . SetCategory ( "inherits ExpressionEvaluator" )
2180
+ . SetCategory ( "Custom operators" ) ;
2181
+
2182
+ yield return new TestCaseData ( xExpressionEvaluator2
2183
+ , "2°#" , null )
2184
+ . Returns ( 0.00390625d )
2185
+ . SetCategory ( "ExpressionEvaluator extend" )
2186
+ . SetCategory ( "inherits ExpressionEvaluator" )
2187
+ . SetCategory ( "Custom operators" ) ;
2188
+
2189
+ yield return new TestCaseData ( xExpressionEvaluator2
2190
+ , "2#° + +-+-~+1" , null )
2191
+ . Returns ( - 1.2928932188134525d )
2192
+ . SetCategory ( "ExpressionEvaluator extend" )
2193
+ . SetCategory ( "inherits ExpressionEvaluator" )
2194
+ . SetCategory ( "Custom operators" ) ;
2195
+
2196
+ yield return new TestCaseData ( xExpressionEvaluator2
2197
+ , "2°# + +-+-~+1" , null )
2198
+ . Returns ( - 1.99609375d )
2199
+ . SetCategory ( "ExpressionEvaluator extend" )
2200
+ . SetCategory ( "inherits ExpressionEvaluator" )
2201
+ . SetCategory ( "Custom operators" ) ;
2202
+
2149
2203
yield return new TestCaseData ( xExpressionEvaluator2
2150
2204
, "1 love 2" , null )
2151
2205
. Returns ( 6 )
0 commit comments