unit tests for sort order