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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
use strict;
use warnings;
use utf8;
no warnings 'utf8';
use Test::More tests => 7;
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-dynamic.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 $section0 = $biber->sections->get_section(0);
my $main0 = $section0->get_list('MAIN');
my $sh0 = $section0->get_list('SHORTHANDS');
my $section1 = $biber->sections->get_section(1);
my $main1 = $section1->get_list('MAIN');
my $sh1 = $section1->get_list('SHORTHANDS');
my $out = $biber->get_output_obj;
my $string1 = q| \entry{DynSet}{set}{}
\set{Dynamic1,Dynamic2,Dynamic3}
\name{labelname}{1}{%
{{Dynamism}{D.}{Derek}{D.}{}{}{}{}}%
}
\name{author}{1}{%
{{Dynamism}{D.}{Derek}{D.}{}{}{}{}}%
}
\strng{namehash}{DD1}
\strng{fullhash}{DD1}
\field{sortinit}{0}
\field{labelyear}{2002}
\field{annotation}{Some Dynamic Note}
\field{shorthand}{d1}
\field{title}{Doing Daring Deeds}
\field{year}{2002}
\endentry
|;
my $string2 = q| \entry{Dynamic1}{book}{}
\inset{DynSet}
\name{labelname}{1}{%
{{Dynamism}{D.}{Derek}{D.}{}{}{}{}}%
}
\name{author}{1}{%
{{Dynamism}{D.}{Derek}{D.}{}{}{}{}}%
}
\strng{namehash}{DD1}
\strng{fullhash}{DD1}
\field{sortinit}{0}
\field{annotation}{Some Dynamic Note}
\field{shorthand}{d1}
\field{title}{Doing Daring Deeds}
\field{year}{2002}
\endentry
|;
my $string3 = q| \entry{Dynamic2}{book}{}
\inset{DynSet}
\name{labelname}{1}{%
{{Bunting}{B.}{Brian}{B.}{}{}{}{}}%
}
\name{author}{1}{%
{{Bunting}{B.}{Brian}{B.}{}{}{}{}}%
}
\strng{namehash}{BB1}
\strng{fullhash}{BB1}
\field{sortinit}{0}
\field{shorthand}{d2}
\field{title}{Beautiful Birthdays}
\field{year}{2010}
\endentry
|;
my $string4 = q| \entry{Dynamic3}{book}{}
\inset{DynSet}
\name{labelname}{1}{%
{{Regardless}{R.}{Roger}{R.}{}{}{}{}}%
}
\name{author}{1}{%
{{Regardless}{R.}{Roger}{R.}{}{}{}{}}%
}
\strng{namehash}{RR1}
\strng{fullhash}{RR1}
\field{sortinit}{0}
\field{shorthand}{d3}
\field{title}{Reckless Ravishings}
\field{year}{2000}
\endentry
|;
# Labelyear is now here as skiplab is not set for this entry when cited in section
# without citation of a set it is a member of
my $string5 = q| \entry{Dynamic3}{book}{}
\name{labelname}{1}{%
{{Regardless}{R.}{Roger}{R.}{}{}{}{}}%
}
\name{author}{1}{%
{{Regardless}{R.}{Roger}{R.}{}{}{}{}}%
}
\strng{namehash}{RR1}
\strng{fullhash}{RR1}
\field{sortinit}{0}
\field{labelyear}{2000}
\field{shorthand}{d3}
\field{title}{Reckless Ravishings}
\field{year}{2000}
\endentry
|;
is($out->get_output_entry($main0,'DynSet'), $string1, 'Dynamic set test 1');
is($out->get_output_entry($main0,'Dynamic1'), $string2, 'Dynamic set test 2');
is($out->get_output_entry($main0,'Dynamic2'), $string3, 'Dynamic set test 3');
is($out->get_output_entry($main0,'Dynamic3'), $string4, 'Dynamic set test 4');
is($out->get_output_entry($main0,'Dynamic3', 1), $string5, 'Dynamic set test 5');
is_deeply([$sh0->get_keys], ['DynSet'], 'Dynamic set skiplos 1');
is_deeply([$sh1->get_keys], ['Dynamic3'], 'Dynamic set skiplos 2');
unlink <*.utf8>;
|