1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
use strict;
use warnings;
use utf8;
no warnings 'utf8';
use Test::More tests => 2;
use Biber;
use Biber::Output::BBL;
use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init($ERROR);
chdir("t/tdata") ;
my $S;
# Set up Biber object
my $biber = Biber->new(noconf => 1);
$biber->parse_ctrlfile('sort-case.bcf');
$biber->set_output_obj(Biber::Output::BBL->new());
# Options - we could set these in the control file but it's nice to see what we're
# relying on here for tests
Biber::Config->setoption('sortcase', 1);
Biber::Config->setoption('sortupper', 1);
$S = [
[
{},
{'author' => {}},
],
];
Biber::Config->setblxoption('sorting', {default => $S});
$biber->prepare;
my $section = $biber->sections->get_section(0);
my $main = $section->get_list('MAIN');
is_deeply([$main->get_keys], ['CS1','CS3','CS2'], 'U::C case - 1');
$biber = Biber->new(noconf => 1);
$biber->parse_ctrlfile('sort-case.bcf');
$biber->set_output_obj(Biber::Output::BBL->new());
# Global here is sortcase=0, sortupper=1
# title is sortcase=1, sortupper=0
# So, all names are the same and it depends on title
$biber->prepare;
$section = $biber->sections->get_section(0);
$section = $biber->sections->get_section(0);
$main = $section->get_list('MAIN');
is_deeply([$main->get_keys], ['CS3','CS2','CS1'], 'U::C case - 2');
unlink <*.utf8>;
|