From 1254f88b25700408492edea9cbacdea5e52c913b Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Fri, 21 Jun 2013 15:31:32 -0400 Subject: [PATCH] Bug 9770: test case for sorting of Dewey call numbers that contain prefixes This adds a test for C4::ClassSortRoutine::Dewey to check that the call number "JR DVD 800.1" sorts before "JR DVD 900" To test: [1] Apply just this patch. [1] Run prove -v t/ClassSortRoutine_Dewey.t [2] Test #7 should fail. Signed-off-by: Jason Etheridge Signed-off-by: Galen Charlton Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer Passes test plan and QA script. Signed-off-by: Galen Charlton (cherry picked from commit bce45b4bf55e82345efed2850d9cb5fd77f3c483) Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 926e455f19852c1c7b69aa00bd587caff8bccd14) Signed-off-by: Bernardo Gonzalez Kriegel (cherry picked from commit 926e455f19852c1c7b69aa00bd587caff8bccd14) Signed-off-by: Chris Hall (cherry picked from commit 74b2f3fb4acec7b4adf54f32bb4eabcf51ca3353) --- t/ClassSortRoutine_Dewey.t | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/t/ClassSortRoutine_Dewey.t b/t/ClassSortRoutine_Dewey.t index 7a4d7f4e4c..ae3549eb76 100755 --- a/t/ClassSortRoutine_Dewey.t +++ b/t/ClassSortRoutine_Dewey.t @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 6; +use Test::More tests => 7; BEGIN { use_ok('C4::ClassSortRoutine::Dewey'); @@ -26,3 +26,7 @@ is($cn_sort,"ABC_123_456000000000000","testing alphanumeric"); $cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key("ab c123","45 6"); is($cn_sort,"AB_C123_45_600000000000000","testing middle whitespace"); + +$cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key("YR DVD 800.1",""); +my $cn_sort2 = C4::ClassSortRoutine::Dewey::get_class_sort_key("YR DVD 900",""); +ok( $cn_sort lt $cn_sort2, "testing prefix plus decimal" ); -- 2.39.5