@@ -1022,6 +1022,7 @@ public static IEnumerable<TestCaseData> TestCasesForWithCustomVariablesExpressio
10221022 Dictionary < string , object > variablesForSimpleVariablesInjection = new Dictionary < string , object > ( )
10231023 {
10241024 { "hello" , "Test" } ,
1025+ { "a" , 0 } ,
10251026 { "x" , 5 } ,
10261027 { "y" , 20 } ,
10271028 { "isThisReal" , true } ,
@@ -1056,6 +1057,10 @@ public static IEnumerable<TestCaseData> TestCasesForWithCustomVariablesExpressio
10561057 yield return new TestCaseData ( "-x + +y" , variablesForSimpleVariablesInjection , true ) . SetCategory ( "SimpleVariablesInjection,Unary both +-" ) . Returns ( 15 ) ;
10571058 yield return new TestCaseData ( "(-x + +y)" , variablesForSimpleVariablesInjection , true ) . SetCategory ( "SimpleVariablesInjection,Unary both +-,Parenthis" ) . Returns ( 15 ) ;
10581059
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+
10591064 yield return new TestCaseData ( "ISTHISREAL" , variablesForSimpleVariablesInjection , false ) . SetCategory ( "SimpleVariablesInjection,IgnoreCase" ) . Returns ( true ) . SetCategory ( "Options, OptionCaseSensitiveEvaluationActive" ) ;
10601065 yield return new TestCaseData ( "isthisreal" , variablesForSimpleVariablesInjection , false ) . SetCategory ( "SimpleVariablesInjection,IgnoreCase" ) . Returns ( true ) . SetCategory ( "Options, OptionCaseSensitiveEvaluationActive" ) ;
10611066 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
21462151 . SetCategory ( "inherits ExpressionEvaluator" )
21472152 . SetCategory ( "Custom operators" ) ;
21482153
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+
21492203 yield return new TestCaseData ( xExpressionEvaluator2
21502204 , "1 love 2" , null )
21512205 . Returns ( 6 )
0 commit comments