Added test case for functions returning a function