Test case for custom compare function