Sorting functions and their test specs