added tests for function invocation pattern