Add test for classes body taking function as param

Ref: https://cfengine.com/dev/issues/4319