public void simplifyTestString(String expr, String expected) throws ParseException { XJep xj = (XJep) j; Node node = xj.parse(expr); Node processed = xj.preprocess(node); Node simp = xj.simplify(processed); String res = xj.toString(simp); if (!expected.equals(res)) System.out.println( "Error: Value of \"" + expr + "\" is \"" + res + "\" should be \"" + expected + "\""); assertEquals("<" + expr + ">", expected, res); System.out.println("Success: Value of \"" + expr + "\" is \"" + res + "\""); }
/** Convert to string */ public String toString() { if (simp != null) { return jep.toString(simp); } return jep.toString(node); }