How to improve function and remove extra from it's code

I think it is better to pass a lambda as an argument to test function. In this case, compiler can catch errors if function or module doesn’t exist.

def test_1(), do: test(&Post.name/1)
def test_2(), do: test(&Post.other_name/1)