@Test public void testParseOrType() { final BinaryMethodNode _node; _node = ((BinaryMethodNode) Parser.factory.parseMethod_("+ arg {String | Nil} ^bar")); assertTrue( st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BinaryMethodNode.factory)); assertEquals((String) "+ arg {String | Nil}\n\t^bar", (String) _node.prettySourceString()); }
@Test public void testParseMethodWithArgType() { final BinaryMethodNode _node; _node = ((BinaryMethodNode) Parser.factory.parseMethod_("+ arg {String} ^bar")); assertTrue( st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BinaryMethodNode.factory)); assertEquals((String) "+ arg {String}\n\t^bar", (String) _node.prettySourceString()); assertTrue(_node.argument().type() != null); assertTrue(_node.returnType() == null); }