@Test
public void testFull() {
final Parser parser = new StandardParser(PARSER_IMPL_FACTORY);
final String source = "//a pre-start comment\n//a start comment\npackage hello.world /* here are some imports */import wow.man import flim.flam "
+ "//an annotation comment\n@foo\n@foo(@bar)\n//datatype comment\nFooBar //equal comment\n= //constructor comment\nfoo //bar comment\n| //really a bar comment\nbar(int hey, final String[] yeah) whatever = whatever";
final ParseResult result = parser.parse(new StringSource("ParserTest",
source));
assertEquals(
new ParseResult(new Doc(
"ParserTest",
Pkg._Pkg(list(_JavaEOLComment("//a pre-start comment"), _JavaEOLComment("//a start comment")), "hello.world"), list(Imprt._Imprt(list(IMPORTS_COMMENT), "wow.man"), Imprt._Imprt(NO_COMMENTS, "flim.flam")),
list(new DataType(list(_JavaEOLComment("//an annotation comment"), _JavaEOLComment("//datatype comment")), list(_Annotation("foo", Optional.<AnnotationElement>_None()), _Annotation("foo", _Some(_ElementValue(_AnnotationValueAnnotation(_Annotation("bar", Optional.<AnnotationElement>_None())))))),
"FooBar",
NO_FORMAL_TYPE_ARGUMENTS, NO_EXTENDS, NO_IMPLEMENTS,
list(
new Constructor(list(_JavaEOLComment("//equal comment"), _JavaEOLComment("//constructor comment")), "foo", Util
.<Arg> list()),
new Constructor(list(_JavaEOLComment("//bar comment"), _JavaEOLComment("//really a bar comment")),
"bar",
list(new Arg(Util
.<ArgModifier> list(),
_Primitive(_IntType()),
"hey"),
new Arg(
list(_Final()),
_Ref(_ArrayType(_Ref(_ClassType(
"String",
NO_ACTUAL_TYPE_ARGUMENTS)))),
"yeah"))))),
new DataType(NO_COMMENTS, NO_ANNOTATIONS, "whatever", NO_FORMAL_TYPE_ARGUMENTS, NO_EXTENDS, NO_IMPLEMENTS,
list(new Constructor(NO_COMMENTS, "whatever", Util
.<Arg> list()))))), Util.<SyntaxError>list()).toString(), result.toString());
}