Ejemplo n.º 1
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);
 }
Ejemplo n.º 2
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);
 }