Skip to content

Commit

Permalink
Add failing test case relating to #16
Browse files Browse the repository at this point in the history
  • Loading branch information
Muqsit committed Nov 3, 2022
1 parent 39da78f commit abdc2a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/muqsit/arithmexp/OptimizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ public function testDivisionOperatorStrengthReductionForEqualOperandsWithGroupin
self::assertEquals(1, $expression->evaluate());
}

public function testDivisionOperatorStrengthReductionForEqualOperandsReturningNan() : void{
$expression = $this->parser->parse("sqrt(-1) / sqrt(-1)");
self::assertInstanceOf(ConstantExpression::class, $expression);
self::assertNan($expression->evaluate());
}

public function testDivisionOperatorStrengthReductionForCommutativelyEqualOperands() : void{
$expression = $this->parser->parse("(x + y + z) / (y + x + z)");
self::assertInstanceOf(ConstantExpression::class, $expression);
Expand Down

0 comments on commit abdc2a0

Please sign in to comment.