Example #1
0
 void checkStr(String s, double d) {
   Env env = Exec2.exec(s);
   assertFalse("Should be scalar result not Frame: " + s, env.isAry());
   assertFalse(env.isFcn());
   double res = env.popDbl();
   assertEquals(d, res, d / 1e8);
   env.remove_and_unlock();
   debug_print(s);
 }
Example #2
0
 void checkStr(String s, String err) {
   Env env = null;
   try {
     env = Exec2.exec(s);
     env.remove_and_unlock();
     fail(); // Supposed to throw; reaching here is an error
   } catch (IllegalArgumentException e) {
     assertEquals(err, e.getMessage());
   }
   debug_print(s);
 }
Example #3
0
 void checkStr(String s) {
   Env env = null;
   try {
     env = Exec2.exec(s);
     if (env.isAry()) { // Print complete frames for inspection
       Frame res = env.popAry();
       String skey = env.key();
       System.out.println(res.toStringAll());
       env.subRef(res, skey); // But then end lifetime
     } else {
       System.out.println(env.resultString());
     }
   } catch (IllegalArgumentException iae) {
     System.out.println(iae.getMessage());
   }
   if (env != null) env.remove_and_unlock();
   debug_print(s);
 }