Skip to content

Commit

Permalink
Missing JUNIT for fix bug in parsers getTimesImplicit()
Browse files Browse the repository at this point in the history
  • Loading branch information
axkr committed Dec 23, 2023
1 parent 9a88e94 commit 4939feb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import static org.matheclipse.core.expression.S.x;
import static org.matheclipse.core.expression.S.y;
import static org.matheclipse.core.expression.S.z;

import org.junit.Test;
import org.matheclipse.core.basic.Config;
import org.matheclipse.core.builtin.Algebra;
Expand Down Expand Up @@ -265,6 +264,40 @@ public void testExpandPerformance006() {
+ "9*u3^4");
}

@Test
public void testExpandPattern() {
check("FullForm(Hold((a(1) + a(2))(x(1) + x(2))^2))", //
"Hold(Times(Plus(a(1), a(2)), Power(Plus(x(1), x(2)), 2)))");
check("FullForm(Hold((a(1) + a(2))*(x(1) + x(2))^2))", //
"Hold(Times(Plus(a(1), a(2)), Power(Plus(x(1), x(2)), 2)))");
check("Expand((a(1) + a(2))*(x(1) + x(2))^2, x(_))", //
"(a(1)+a(2))*x(1)^2+2*(a(1)+a(2))*x(1)*x(2)+(a(1)+a(2))*x(2)^2");
}

// @Test
// public void testExpandDenominator() {
// check("ExpandDenominator((x+y)*(x-y)/((x+1)*y))", //
// "((x-y)*(x+y))/(y+x*y)");
// check("ExpandDenominator((x - 1) (x - 2)/((x - 3) (x - 4)))", //
// "((-2+x)*(-1+x))/(12-7*x+x^2)");
// check("ExpandDenominator(1/(x + 1) + 2/(x + 1)^2 + 3/(x + 1)^3)", //
// "1/(1+x)+2/(1+2*x+x^2)+3/(1+3*x+3*x^2+x^3)");
// check("ExpandDenominator(x == c/(a + b)^2 && y >= c/(a - b)^2)", //
// "x==c/(a^2+2*a*b+b^2)&&y>=c/(a^2-2*a*b+b^2)");
// }
//
// @Test
// public void testExpandNumerator() {
// check("ExpandNumerator((x+y)*(x-y)/((x+1)*y))", //
// "(x^2-y^2)/((1+x)*y)");
// check("ExpandNumerator((x - 1) (x - 2)/((x - 3) (x - 4)))", //
// "(2-3*x+x^2)/((-4+x)*(-3+x))");
// check("ExpandNumerator((a + b)^2/x + (c + d) (c - d)/y)", //
// "(a^2+2*a*b+b^2)/x+(c^2-d^2)/y");
// check("ExpandNumerator(x == (a + b)^2/c && y >= (a - b)^2/c)", //
// "x==(a^2+2*a*b+b^2)/c&&y>=(a^2-2*a*b+b^2)/c");
// }

@Test
public void testRationalFunction001() {
check("PolynomialQ(x^2*(a+b*x^3)^16,x)", //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void testParser0() {
@Test
void testParser1() {
ASTNode obj = PARSE_RELAXED.parse("a()(0)(1)f[[x]]");
assertEquals("Times(Times(a(), Times(0, 1)), Part(f, x))", obj.toString());
assertEquals("Times(a(), Times(Times(0, 1), Part(f, x)))", obj.toString());
}

@Test
Expand Down

0 comments on commit 4939feb

Please sign in to comment.