added test for sort condition.