Bugzilla – Attachment 14714 Details for
Bug 6281
Bug in LCC sort routine
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
bug 6281: add test case for sorting LC call numbers correctly
bug-6281-add-test-case-for-sorting-LC-call-numbers.patch (text/plain), 1.93 KB, created by
Kyle M Hall
on 2013-01-18 20:05:00 UTC
(
hide
)
Description:
bug 6281: add test case for sorting LC call numbers correctly
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2013-01-18 20:05:00 UTC
Size:
1.93 KB
patch
obsolete
>From cd4dfe6a81dd7b5df45da490edc97f9d14352955 Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Fri, 17 Aug 2012 11:17:03 -0400 >Subject: [PATCH] bug 6281: add test case for sorting LC call numbers correctly > >My thanks to Michael Flanagan of UCAR for providing some of >these examples. > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/ClassSortRoutine_LCC.t | 20 +++++++++++++++++++- > 1 files changed, 19 insertions(+), 1 deletions(-) > >diff --git a/t/ClassSortRoutine_LCC.t b/t/ClassSortRoutine_LCC.t >index 573c8fe..7454351 100755 >--- a/t/ClassSortRoutine_LCC.t >+++ b/t/ClassSortRoutine_LCC.t >@@ -6,7 +6,7 @@ > use strict; > use warnings; > >-use Test::More tests => 9; >+use Test::More tests => 10; > > BEGIN { > use_ok('C4::ClassSortRoutine::LCC'); >@@ -25,3 +25,21 @@ is(C4::ClassSortRoutine::LCC::get_class_sort_key(' ',' '), "", "Arguments ' ' > is(C4::ClassSortRoutine::LCC::get_class_sort_key('.','b'), "_B", "Arguments '.','b' return '_B'"); > is(C4::ClassSortRoutine::LCC::get_class_sort_key('....','........'), "_______", "Arguments '....','........' return '_______'"); > is(C4::ClassSortRoutine::LCC::get_class_sort_key('.','.'), "__", "Arguments '.','.' return '__'"); >+ >+# list of example call numbers -- these >+# are intentionally in the _reverse_ of >+# the correct sort order >+my @call_numbers = ( >+ 'SB410.9 .P26 1993', >+ 'SB410.A26 I75 2000', >+ 'QC995 .E29 1997', >+ 'QC145.45 .H4 D65 1998', >+ 'QC145 .A57 V.12 1980', >+ 'QC100 .U57 NO. 555 1986', >+); >+ >+my @sorted_call_numbers = map { $_->{call_number} } >+ sort { $a->{sortkey} cmp $b->{sortkey} } >+ map { { call_number => $_, sortkey => C4::ClassSortRoutine::LCC::get_class_sort_key($_, '') } } >+ @call_numbers; >+is_deeply(\@sorted_call_numbers, [ reverse @call_numbers ], 'LC call numbers sorted in correct order'); >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6281
:
14478
|
14479
|
14480
|
14714
|
14715
|
14716
|
18527
|
18528
|
18529
|
18780
|
18781
|
18782