public void evalAndCompareTo(String input, String output) { try { ATObject result = evalAndReturn(input); if (result != null) { assertEquals(output, result.meta_print().javaValue); } } catch (InterpreterException e) { fail(e.getMessage()); } }
public void testSelection() { try { ATObject clo = evalAndReturn("mirrorOn1.select(mirrorOn1.base, `+)"); ATClosure c = clo.asClosure(); ATMethod m = c.base_method(); // assertEquals(NativeMethod.class, m.getClass()); assertEquals(AGSymbol.jAlloc("+"), m.base_name()); assertEquals( NATNumber.atValue(2), c.base_apply(NATTable.atValue(new ATObject[] {NATNumber.ONE}))); } catch (InterpreterException e) { fail(e.getMessage()); } }
public void printedEquals(ATObject input, String expected) { try { assertEquals(expected, input.meta_print().javaValue); } catch (InterpreterException e) { fail(e.getMessage()); } }