Add tests for `sort_items`.