Test for comparison function