pubdate => 'pubdate',
);
my %sort_order_convert =
- ( qw( dsc desc ), qw( asc asc ), qw( az asc ), qw( za desc ) );
+ ( qw( desc desc ), qw( dsc desc ), qw( asc asc ), qw( az asc ), qw( za desc ) );
# Convert the fields and orders, drop anything we don't know about.
grep { $_->{field} } map {
};
subtest "_convert_sort_fields" => sub {
- plan tests => 1;
+ plan tests => 2;
my @sort_by = $builder->_convert_sort_fields(qw( call_number_asc author_dsc ));
is_deeply(
\@sort_by,
);
# We could expect this to pass, but direction is undef instead of 'desc'
- #@sort_by = $builder->_convert_sort_fields(qw( call_number_asc author_desc ));
- #is_deeply(
- # \@sort_by,
- # [
- # { field => 'callnum', direction => 'asc' },
- # { field => 'author', direction => 'desc' }
- # ],
- # 'sort fields should have been split correctly'
- #);
+ @sort_by = $builder->_convert_sort_fields(qw( call_number_asc author_desc ));
+ is_deeply(
+ \@sort_by,
+ [
+ { field => 'callnum', direction => 'asc' },
+ { field => 'author', direction => 'desc' }
+ ],
+ 'sort fields should have been split correctly'
+ );
};