@@ -487,9 +487,9 @@ void testSameExpressionTwiceShouldSimplifyToSingle() {
487487 }
488488
489489 @ Test
490- void testCircularDependencyShouldNotSimplify () {
490+ void testSymmetricEqualityShouldSimplify () {
491491 // Given: x == y && y == x
492- // Expected: x == y && y == x (should not be simplified to "true")
492+ // Expected: x == y
493493
494494 Expression varX = new Var ("x" );
495495 Expression varY = new Var ("y" );
@@ -502,15 +502,8 @@ void testCircularDependencyShouldNotSimplify() {
502502
503503 // Then
504504 assertNotNull (result , "Result should not be null" );
505- assertEquals ("x == y && y == x" , result .getValue ().toString (),
506- "Circular dependency should not be simplified to a boolean literal" );
507-
508- // The result should be the original expression unchanged
509- assertInstanceOf (BinaryExpression .class , result .getValue (), "Result should still be a binary expression" );
510- BinaryExpression resultExpr = (BinaryExpression ) result .getValue ();
511- assertEquals ("&&" , resultExpr .getOperator (), "Operator should still be &&" );
512- assertEquals ("x == y" , resultExpr .getFirstOperand ().toString (), "Left operand should be x == y" );
513- assertEquals ("y == x" , resultExpr .getSecondOperand ().toString (), "Right operand should be y == x" );
505+ assertEquals ("x == y" , result .getValue ().toString (),
506+ "Symmetric equality should be simplified to a single equality" );
514507 }
515508
516509 @ Test
0 commit comments