Skip to content

Commit

Permalink
Fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Saymon committed Jun 22, 2023
1 parent f5ba976 commit e5e1939
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 0 additions & 6 deletions src/fintamath/expressions/binary/DivExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ ArgumentPtr DivExpression::denominatorSumSimplify(const ArgumentPtr &lhs, const
if (const auto &childForAdd = denominatorMulSimplify(exprChild->getChildren())) {
multiplicator.emplace_back(childForAdd);
}
continue;
}
}

Expand All @@ -528,13 +527,8 @@ ArgumentPtr DivExpression::denominatorSumSimplify(const ArgumentPtr &lhs, const
ArgumentPtr DivExpression::denominatorMulSimplify(const ArgumentsPtrVector &rhsChildren) {
ArgumentsPtrVector multiplicator;
for (const auto &child : rhsChildren) {
if (const auto &divChild = cast<DivExpression>(child)) {
multiplicator.emplace_back(divChild->rhsChild);
continue;
}
if (const auto &rationalChild = cast<Rational>(child)) {
multiplicator.emplace_back(std::make_shared<Integer>(rationalChild->denominator()));
continue;
}
}

Expand Down
1 change: 1 addition & 0 deletions tests/src/expressions/ExpressionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ TEST(ExpressionTests, stringConstructorTest) {
EXPECT_EQ(Expression("(a b)/-2").toString(), "-1/2 a b");
EXPECT_EQ(Expression("(a b)/(-a - b)").toString(), "-b + b^2/(a + b)");
EXPECT_EQ(Expression("(x^5)/(x - y)").toString(), "x^4 + x^3 y + x^2 y^2 + x y^3 + y^4 + y^5/(x - y)");
EXPECT_EQ(Expression("(3 x + 5/9)/(2y - 9/x + 3/2 x + 1/2 + 2 y / x)").toString(), "2 - (16 y - 72)/(6 x^2 + 8 x y + 2 x + 8 y - 36) + (-16 x^2 y)/(6 x^3 + 8 x^2 y + 2 x^2 + 8 x y - 36 x) + (-16 x)/(54 x^2 + 72 x y + 18 x + 72 y - 324)");

EXPECT_EQ(Expression("0^a").toString(), "0");
EXPECT_EQ(Expression("(a b)^0").toString(), "1");
Expand Down

0 comments on commit e5e1939

Please sign in to comment.