Add tests for the functor case