Sort listdir output for proper test result.