Skip to content

Commit 3089f2e

Browse files
Copilotdadhi
andauthored
Clarify canonicalization test expectations
Agent-Logs-Url: https://github.com/dadhi/FastExpressionCompiler/sessions/5ca8e295-4a63-4eb7-92fb-705afa82cdf4 Co-authored-by: dadhi <39516+dadhi@users.noreply.github.com>
1 parent 16365f6 commit 3089f2e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

test/FastExpressionCompiler.LightExpression.UnitTests/LightExpressionTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,9 @@ public void Can_canonicalize_directly_built_flat_expression()
518518
expectedParameter)
519519
.ToFlatExpression();
520520

521-
Asserts.IsTrue(fe.Nodes.Count > canonical.Nodes.Count);
521+
// Direct construction keeps one unreachable constant plus four cloned linkable leaves
522+
// (parameter, variable, label target, and nested-lambda capture) that disappear after canonical rebuild.
523+
Asserts.AreEqual(expected.Nodes.Count + 5, fe.Nodes.Count);
522524
AssertFlatShapeIgnoringParameterNamesAndConstantValues(expected, canonical);
523525
Asserts.AreEqual(6, ((System.Linq.Expressions.Expression<Func<int, int>>)canonical.ToExpression()).Compile()(5));
524526
}

0 commit comments

Comments
 (0)