summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/bibtex/biber/t/11-set-legacy.t
blob: 3691c47b8fabf473241d78b8131f9ce72fcb233c (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
use strict;
use warnings;
use utf8;
no warnings 'utf8';

use Test::More tests => 3;

use Biber;
use Biber::Output::BBL;
use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init($ERROR);
chdir("t/tdata") ;

# Set up Biber object
my $biber = Biber->new(noconf => 1);
$biber->parse_ctrlfile('set-legacy.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 options
Biber::Config->setoption('fastsort', 1);

# Now generate the information
$biber->prepare;
my $section = $biber->sections->get_section(0);
my $main = $section->get_list('MAIN');
my $out = $biber->get_output_obj;

my $string1 = q|  \entry{Elias1955}{set}{}
    \set{Elias1955a,Elias1955b}
    \name{labelname}{1}{%
      {{Elias}{E.}{P.}{P.}{}{}{}{}}%
    }
    \name{author}{1}{%
      {{Elias}{E.}{P.}{P.}{}{}{}{}}%
    }
    \strng{namehash}{EP1}
    \strng{fullhash}{EP1}
    \field{sortinit}{0}
    \field{labelyear}{1955}
    \field{issn}{0096-1000}
    \field{journaltitle}{IRE Transactions on Information Theory}
    \field{month}{03}
    \field{number}{1}
    \field{title}{Predictive coding--I}
    \field{volume}{1}
    \field{year}{1955}
    \field{pages}{16\bibrangedash 24}
    \verb{doi}
    \verb 10.1109/TIT.1955.1055126
    \endverb
    \warn{\item Field 'crossref' is no longer needed in set entries in Biber - ignoring in entry 'Elias1955'}
  \endentry

|;

my $string2 = q|  \entry{Elias1955a}{article}{}
    \inset{Elias1955}
    \name{labelname}{1}{%
      {{Elias}{E.}{P.}{P.}{}{}{}{}}%
    }
    \name{author}{1}{%
      {{Elias}{E.}{P.}{P.}{}{}{}{}}%
    }
    \strng{namehash}{EP1}
    \strng{fullhash}{EP1}
    \field{sortinit}{0}
    \field{issn}{0096-1000}
    \field{journaltitle}{IRE Transactions on Information Theory}
    \field{month}{03}
    \field{number}{1}
    \field{title}{Predictive coding--I}
    \field{volume}{1}
    \field{year}{1955}
    \field{pages}{16\bibrangedash 24}
    \verb{doi}
    \verb 10.1109/TIT.1955.1055126
    \endverb
    \warn{\item Field 'entryset' is no longer needed in set member entries in Biber - ignoring in entry 'Elias1955a'}
  \endentry

|;

my $string3 = q|  \entry{Elias1955b}{article}{}
    \inset{Elias1955}
    \name{labelname}{1}{%
      {{Elias}{E.}{P.}{P.}{}{}{}{}}%
    }
    \name{author}{1}{%
      {{Elias}{E.}{P.}{P.}{}{}{}{}}%
    }
    \strng{namehash}{EP1}
    \strng{fullhash}{EP1}
    \field{sortinit}{0}
    \field{issn}{0096-1000}
    \field{journaltitle}{IRE Transactions on Information Theory}
    \field{month}{03}
    \field{number}{1}
    \field{title}{Predictive coding--II}
    \field{volume}{1}
    \field{year}{1955}
    \field{pages}{24\bibrangedash 33}
    \verb{doi}
    \verb 10.1109/TIT.1955.1055116
    \endverb
    \warn{\item Field 'entryset' is no longer needed in set member entries in Biber - ignoring in entry 'Elias1955b'}
  \endentry

|;

is($out->get_output_entry($main,'elias1955'), $string1, 'Legacy set test 1');
is($out->get_output_entry($main,'elias1955a'), $string2, 'Legacy set test 2');
is($out->get_output_entry($main,'elias1955b'), $string3, 'Legacy set test 3');

unlink <*.utf8>;