summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/bibtex/biber/t/20-sortlists.t
blob: cbf9bc63a5c7c54ca6def52cf7783b113c05bdaa (plain)
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
use strict;
use warnings;
use utf8;
no warnings 'utf8';

use Test::More tests => 8;

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('sortlists.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('fastsort', 1);

# (re)generate informtion based on option settings
$biber->prepare;
my $section = $biber->sections->get_section(0);
my $out = $biber->get_output_obj;

is_deeply([$section->get_list('lname')->get_keys], ['K1', 'K2', 'K4', 'K3'], 'List - name order');
is_deeply([$section->get_list('lyear')->get_keys], ['K4', 'K1', 'K2', 'K3'], 'List - year order');
is_deeply([$section->get_list('ltitle')->get_keys], ['K1', 'K4', 'K2', 'K3'], 'List - title order');
is_deeply([$section->get_list('lnamef1')->get_keys], ['K2', 'K4'], 'List - name order (filtered) - 1');
is_deeply([$section->get_list('lnamef2')->get_keys], ['K4'], 'List - name order (filtered) - 2');
is_deeply([$section->get_list('lnamef3')->get_keys], ['K1', 'K2'], 'List - name order (filtered) - 3');
is_deeply([$section->get_list('lnamef4')->get_keys], ['K3'], 'List - name order (filtered) - 4');
is_deeply([$section->get_list('lnamef5')->get_keys], ['K1', 'K3'], 'List - name order (filtered) - 5');

unlink <*.utf8>;