assertEquals("foo", callFooAgain.getName());
assertEquals(0, callFooAgain.getChildren().size());
}
public void testSequentialFunctionCalls() throws Exception {
TranslationUnit unit = parse(
"class A { public: void foo() {} }; " +
"A bar() { A a; return a; } " +
"void main() { bar().foo(); } ");
FunctionDefinition functionMain = unit.getChild(2);
assertEquals("main", functionMain.getName());
ExpressionStatement expressionStatement = functionMain.getChild(0);
FunctionInvocation callBar = expressionStatement.getExpression(0);
assertEquals("bar", callBar.getName());
FunctionInvocation callFoo = callBar.getChild(0);