Add test for sort function.