Skip to content

Commit 489b3f7

Browse files
committed
adding tests and removing last excpetion in interpreter
1 parent 5a15c51 commit 489b3f7

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/FastExpressionCompiler/FastExpressionCompiler.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8480,8 +8480,9 @@ internal static bool TryInterpretPrimitiveValue(ref PValue result, Expression ex
84808480
case TypeCode.UInt64: result.UInt64Value = (ulong)operandDec; break;
84818481
case TypeCode.Single: result.SingleValue = (float)operandDec; break;
84828482
case TypeCode.Double: result.DoubleValue = (double)operandDec; break;
8483-
// todo: @wip #472 check if it is converted to the nullable or object
8484-
default: UnreachableCase(expr.Type); break;
8483+
default:
8484+
// todo: @feature #472 support conversion to nullable, put nullable marker into PValue or something
8485+
return false;
84858486
}
84868487
return true;
84878488
}

test/FastExpressionCompiler.TestsRunner.Net472/Program.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ static void RunLightExpressionTests(object state)
3535

3636
var t = (LightExpression.TestRun)state;
3737
t.Run(new LightExpression.IssueTests.Issue183_NullableDecimal());
38+
t.Run(new LightExpression.IssueTests.Issue468_Optimize_the_delegate_access_to_the_Closure_object_for_the_modern_NET());
39+
t.Run(new LightExpression.IssueTests.Issue472_TryInterpret_and_Reduce_primitive_arithmetic_and_logical_expressions_during_the_compilation());
40+
t.Run(new LightExpression.IssueTests.Issue473_InvalidProgramException_when_using_Expression_Condition_with_converted_decimal_expression());
3841

3942
Console.WriteLine($"Just LightExpression tests are passing in {justLightTestsStopwatch.ElapsedMilliseconds} ms.");
4043
}
@@ -46,6 +49,10 @@ static void RunLightExpressionTests(object state)
4649

4750
var fecTests = new TestRun();
4851
fecTests.Run(new Issue183_NullableDecimal());
52+
fecTests.Run(new Issue468_Optimize_the_delegate_access_to_the_Closure_object_for_the_modern_NET());
53+
fecTests.Run(new Issue472_TryInterpret_and_Reduce_primitive_arithmetic_and_logical_expressions_during_the_compilation());
54+
fecTests.Run(new Issue473_InvalidProgramException_when_using_Expression_Condition_with_converted_decimal_expression());
55+
4956

5057
Console.WriteLine($"FEC tests are passing in {fecTestsStopwatch.ElapsedMilliseconds} ms.");
5158

@@ -65,7 +72,7 @@ static void RunLightExpressionTests(object state)
6572
}
6673

6774
var totalTestCount = fecTests.TotalTestCount + lightTests.TotalTestCount;
68-
Console.WriteLine($"TestX {totalTestCount,-4} tests are passing in {totalStopwatch.ElapsedMilliseconds} ms.");
75+
Console.WriteLine($"TestX: {totalTestCount,-4} tests are passing in {totalStopwatch.ElapsedMilliseconds} ms.");
6976
}
7077

7178
public static void RunAllTests()

0 commit comments

Comments
 (0)