Browse Source

Add pretty test for checked arithmetic in expression trees

AddChecked/MultiplyChecked/ConvertChecked nodes were not covered;
they are pretty-printed as a checked block around the tree-building
calls.

Assisted-by: Claude:claude-fable-5:Claude Code
pull/3857/head
Siegfried Pammer 4 days ago committed by Siegfried Pammer
parent
commit
f59b76a655
  1. 11
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs

11
ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs

@ -944,6 +944,17 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -944,6 +944,17 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
ToCode(null, (int? a) => a & (int?)2);
ToCode(null, (int? a) => a & a);
}
public void CheckedArithmetic()
{
checked
{
ToCode(null, (int a, int b) => a + b);
ToCode(null, (int a, int b) => a - b);
ToCode(null, (int a, int b) => a * b);
ToCode(null, (int a) => (short)a);
}
}
}
internal static class Extensions

Loading…
Cancel
Save