Пример #1
0
 @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());
 }
Пример #2
0
 @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);
 }