Fixed number to decimal parsing, additional tests

This commit is contained in:
Jordan Wages 2025-08-19 05:15:13 -05:00
commit 362af6f7bf
5 changed files with 15 additions and 4 deletions

View file

@ -36,8 +36,10 @@ public class InputInterpreterTests
[TestCase("7%4", 3)]
[TestCase("2^3", 8)]
[TestCase("1e2", 100)]
[TestCase("2.0e2", 200)]
[TestCase("0xFF", 255)]
[TestCase("1010b", 10)]
[TestCase("0xFF*1010b", 2550)]
public void Arithmetic_Works(string expr, decimal expected)
{
var result = _interp.Interpret(expr);
@ -85,7 +87,7 @@ public class InputInterpreterTests
[Test]
public void ExpressionBinding_InvalidExpression_ProducesSoftError()
{
_interp.Interpret("exp := bad + 1");
_interp.Interpret("exp :== bad + 1");
var result = _interp.Interpret("exp");
AssertSoftError(result, _interp);
}