tests for the function