Skip to content

Commit

Permalink
Fixed FactorTest.Test4
Browse files Browse the repository at this point in the history
  • Loading branch information
avighnac committed Mar 20, 2024
1 parent 76e8a26 commit 6dd7363
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/factor_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ TEST(FactorTests, Test3) {
TEST(FactorTests, Test4) {
std::string result;
result = call_arithmetica_tui("factor x^4-25x^2+144");
ASSERT_EQ(result, "arithmetica> factor x^4-25x^2+144\\n\\n==> (x - 4)(x - 3)(x + 3)(x + 4)\\n\\narithmetica> exit\\n");
ASSERT_EQ(result, "arithmetica> factor x^4-25x^2+144\\n\\n==> (x - 4)(x + 4)(x - 3)(x + 3)\\n\\narithmetica> exit\\n");
result = call_arithmetica_tui("showsteps\nfactor x^4-25x^2+144");
ASSERT_EQ(result, "arithmetica> showsteps\\nshowsteps is now true\\narithmetica> factor x^4-25x^2+144\\n\\n==> x^4 - 25x^2 + 144\\n==> x^4 + 4x^3 - 4x^3 - 16x^2 - 9x^2 - 36x + 36x + 144\\n==> x^3(x + 4) - 4x^2(x + 4) - 9x(x + 4) + 36(x + 4)\\n==> (x^3 - 4x^2 - 9x + 36)(x + 4)\\n==> (x^3 + 3x^2 - 7x^2 - 21x + 12x + 36)(x + 4)\\n==> (x^2(x + 3) - 7x(x + 3) + 12(x + 3))(x + 4)\\n==> (x^2 - 7x + 12)(x + 3)(x + 4)\\n==> (x^2 - 3x - 4x + 12)(x + 3)(x + 4)\\n==> (x(x - 3) - 4(x - 3))(x + 3)(x + 4)\\n==> (x - 4)(x - 3)(x + 3)(x + 4)\\n\\narithmetica> exit\\n");
ASSERT_EQ(result, "arithmetica> showsteps\\nshowsteps is now true\\narithmetica> factor x^4-25x^2+144\\n\\n==> x^4 - 25x^2 + 144\\n==> x^4 + 3x^3 - 3x^3 - 9x^2 - 16x^2 - 48x + 48x + 144\\n==> x^3(x + 3) - 3x^2(x + 3) - 16x(x + 3) + 48(x + 3)\\n==> (x^3 - 3x^2 - 16x + 48)(x + 3)\\n==> (x^2(x - 3) - 16(x - 3))(x + 3)\\n==> (x^2 - 16)(x - 3)(x + 3)\\n==> (x^2 + 4x - 4x - 16)(x - 3)(x + 3)\\n==> (x(x + 4) - 4(x + 4))(x - 3)(x + 3)\\n==> (x - 4)(x + 4)(x - 3)(x + 3)\\n\\narithmetica> exit\\n");
}

0 comments on commit 6dd7363

Please sign in to comment.