示例#1
0
  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 + "\"");
  }
示例#2
0
 /** Convert to string */
 public String toString() {
   if (simp != null) {
     return jep.toString(simp);
   }
   return jep.toString(node);
 }