tests: Add test of the sort function.