From 699b5d92697d3c6bb0ef17882d0c9714fb6d7dee Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Fri, 20 Jul 2012 17:50:04 -0500 Subject: [PATCH] Add test coverage for alphabetic sort alphanumeric_key should sort filenames correctly when they differ in text, not just numbers. --- skimage/io/tests/test_collection.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/skimage/io/tests/test_collection.py b/skimage/io/tests/test_collection.py index 969d3e56..c8ba154a 100644 --- a/skimage/io/tests/test_collection.py +++ b/skimage/io/tests/test_collection.py @@ -24,9 +24,11 @@ class TestAlphanumericKey(): def setUp(self): self.test_string = 'z23a' self.test_str_result = ['z', 23, 'a'] - self.filenames = ['f9.10.png', 'f9.9.png', 'f10.10.png', 'f10.9.png'] + self.filenames = ['f9.10.png', 'f9.9.png', 'f10.10.png', 'f10.9.png', + 'e9.png', 'e10.png', 'em.png'] self.sorted_filenames = \ - ['f9.9.png', 'f9.10.png', 'f10.9.png', 'f10.10.png'] + ['e9.png', 'e10.png', 'em.png', 'f9.9.png', 'f9.10.png', + 'f10.9.png', 'f10.10.png'] def test_string_split(self): assert_equal(alphanumeric_key(self.test_string), self.test_str_result)