use of org.matheclipse.parser.client.Parser in project symja_android_library by axkr.
the class ParserTestCase method testParser18.
public void testParser18() {
try {
Parser p = new Parser();
ASTNode obj = p.parse("(a+b)[x]");
assertEquals(obj.toString(), "Plus(a, b)[x]");
} catch (Exception e) {
e.printStackTrace();
assertEquals("", e.getMessage());
}
}
use of org.matheclipse.parser.client.Parser in project symja_android_library by axkr.
the class ParserTestCase method testParser4.
public void testParser4() {
try {
Parser p = new Parser();
ASTNode obj = p.parse("$a=2");
assertEquals(obj.toString(), "Set($a, 2)");
} catch (Exception e) {
e.printStackTrace();
assertEquals("", e.getMessage());
}
}
use of org.matheclipse.parser.client.Parser in project symja_android_library by axkr.
the class ParserTestCase method testParser5.
public void testParser5() {
try {
Parser p = new Parser();
ASTNode obj = p.parse("4.7942553860420304E-1");
assertEquals(obj.toString(), "4.7942553860420304E-1");
} catch (Exception e) {
e.printStackTrace();
assertEquals("", e.getMessage());
}
}
use of org.matheclipse.parser.client.Parser in project symja_android_library by axkr.
the class ParserTestCase method testParser2.
public void testParser2() {
try {
Parser p = new Parser();
ASTNode obj = p.parse("a[][0][1]f[[x]]");
assertEquals(obj.toString(), "Times(a()[0][1], Part(f, x))");
} catch (Exception e) {
e.printStackTrace();
assertEquals("", e.getMessage());
}
}
use of org.matheclipse.parser.client.Parser in project symja_android_library by axkr.
the class ParserTestCase method testParser1.
public void testParser1() {
try {
Parser p = new Parser();
ASTNode obj = p.parse("Integrate[Sin[x]^2+3*x^4, x]");
assertEquals(obj.toString(), "Integrate(Plus(Power(Sin(x), 2), Times(3, Power(x, 4))), x)");
} catch (Exception e) {
e.printStackTrace();
assertEquals("", e.getMessage());
}
}
Aggregations