parser.hasErrors() );
assertEquals( "foo",
pkg.getName() );
assertEquals( 2,
pkg.getImports().size() );
ImportDescr impdescr = pkg.getImports().get( 0 );
assertEquals( "foo.bar.*",
impdescr.getTarget() );
assertEquals( source.indexOf( "import " + impdescr.getTarget() ),
impdescr.getStartCharacter() );
assertEquals( source.indexOf( "import " + impdescr.getTarget() ) + ("import " + impdescr.getTarget()).length(),
impdescr.getEndCharacter() );
impdescr = pkg.getImports().get( 1 );
assertEquals( "baz.Baz",
impdescr.getTarget() );
assertEquals( source.indexOf( "import " + impdescr.getTarget() ),
impdescr.getStartCharacter() );
assertEquals( source.indexOf( "import " + impdescr.getTarget() ) + ("import " + impdescr.getTarget()).length(),
impdescr.getEndCharacter() );
assertEquals( 2,
pkg.getFunctionImports().size() );
impdescr = pkg.getFunctionImports().get( 0 );
assertEquals( "java.lang.Math.max",
impdescr.getTarget() );
assertEquals( source.indexOf( "import function " + impdescr.getTarget() ),
impdescr.getStartCharacter() );
assertEquals( source.indexOf( "import function " + impdescr.getTarget() ) + ("import function " + impdescr.getTarget()).length(),
impdescr.getEndCharacter() );
impdescr = pkg.getFunctionImports().get( 1 );
assertEquals( "java.lang.Math.min",
impdescr.getTarget() );
assertEquals( source.indexOf( "import function " + impdescr.getTarget() ),
impdescr.getStartCharacter() );
assertEquals( source.indexOf( "import function " + impdescr.getTarget() ) + ("import function " + impdescr.getTarget()).length() + 1,
impdescr.getEndCharacter() );
}