SHA256
1
0
forked from pool/texlive
texlive/biber-dev.patch

250 lines
9.1 KiB
Diff

diff --git lib/Biber/Entry.pm lib/Biber/Entry.pm
index adec127..9c6fc4b 100644
--- lib/Biber/Entry.pm
+++ lib/Biber/Entry.pm
@@ -362,9 +362,9 @@ sub get_field_form_names {
my $self = shift;
my $key = shift;
return undef unless $key;
- return keys %{Dive($self, 'datafields', $key) ||
- Dive($self, 'derivedfields', $key) ||
- {}};
+ return sort keys %{Dive($self, 'datafields', $key) ||
+ Dive($self, 'derivedfields', $key) ||
+ {}};
}
=head2 get_field_form_lang_names
@@ -378,9 +378,9 @@ sub get_field_form_lang_names {
my ($key, $form) = @_;
return undef unless $key;
return undef unless $form;
- return keys %{Dive($self, 'datafields', $key, $form) ||
- Dive($self, 'derivedfields', $key, $form) ||
- {}};
+ return sort keys %{Dive($self, 'datafields', $key, $form) ||
+ Dive($self, 'derivedfields', $key, $form) ||
+ {}};
}
=head2 set_datafield
diff --git lib/Biber/LaTeX/Recode.pm lib/Biber/LaTeX/Recode.pm
index ed87c2c..534f0c6 100644
--- lib/Biber/LaTeX/Recode.pm
+++ lib/Biber/LaTeX/Recode.pm
@@ -130,21 +130,21 @@ sub init_schemes {
# Now populate the regexps
if ($type eq 'accents') {
- $remaps->{$set}{$type}{re} = '[' . join('', keys %{$remaps->{$set}{$type}{map}}) . ']';
+ $remaps->{$set}{$type}{re} = '[' . join('', sort keys %{$remaps->{$set}{$type}{map}}) . ']';
$remaps->{$set}{$type}{re} = qr/$remaps->{$set}{$type}{re}/;
- $r_remaps->{$set}{$type}{re} = '[' . join('', keys %{$r_remaps->{$set}{$type}{map}}) . ']';
+ $r_remaps->{$set}{$type}{re} = '[' . join('', sort keys %{$r_remaps->{$set}{$type}{map}}) . ']';
$r_remaps->{$set}{$type}{re} = qr/$r_remaps->{$set}{$type}{re}/;
}
elsif ($type eq 'superscripts') {
- $remaps->{$set}{$type}{re} = join('|', map { /[\+\-\)\(]/ ? '\\' . $_ : $_ } keys %{$remaps->{$set}{$type}{map}});
+ $remaps->{$set}{$type}{re} = join('|', map { /[\+\-\)\(]/ ? '\\' . $_ : $_ } sort keys %{$remaps->{$set}{$type}{map}});
$remaps->{$set}{$type}{re} = qr|$remaps->{$set}{$type}{re}|;
- $r_remaps->{$set}{$type}{re} = join('|', map { /[\+\-\)\(]/ ? '\\' . $_ : $_ } keys %{$r_remaps->{$set}{$type}{map}});
+ $r_remaps->{$set}{$type}{re} = join('|', map { /[\+\-\)\(]/ ? '\\' . $_ : $_ } sort keys %{$r_remaps->{$set}{$type}{map}});
$r_remaps->{$set}{$type}{re} = qr|$r_remaps->{$set}{$type}{re}|;
}
else {
- $remaps->{$set}{$type}{re} = join('|', keys %{$remaps->{$set}{$type}{map}});
+ $remaps->{$set}{$type}{re} = join('|', sort keys %{$remaps->{$set}{$type}{map}});
$remaps->{$set}{$type}{re} = qr|$remaps->{$set}{$type}{re}|;
- $r_remaps->{$set}{$type}{re} = join('|', keys %{$r_remaps->{$set}{$type}{map}});
+ $r_remaps->{$set}{$type}{re} = join('|', sort keys %{$r_remaps->{$set}{$type}{map}});
$r_remaps->{$set}{$type}{re} = qr|$r_remaps->{$set}{$type}{re}|;
}
}
@@ -192,7 +192,7 @@ sub latex_decode {
my $mainmap;
- foreach my $type (keys %{$remaps->{$scheme_d}}) {
+ foreach my $type (sort keys %{$remaps->{$scheme_d}}) {
my $map = $remaps->{$scheme_d}{$type}{map};
my $re = $remaps->{$scheme_d}{$type}{re};
if ($type eq 'negatedsymbols') {
@@ -217,7 +217,7 @@ sub latex_decode {
# special cases such as '\={\i}' -> '\={i}' -> "i\x{304}"
$text =~ s/(\\(?:$d_re|$a_re)){\\i}/$1\{i\}/g;
- foreach my $type (keys %{$remaps->{$scheme_d}}) {
+ foreach my $type (sort keys %{$remaps->{$scheme_d}}) {
my $map = $remaps->{$scheme_d}{$type}{map};
my $re = $remaps->{$scheme_d}{$type}{re};
next unless $re;
@@ -269,7 +269,7 @@ Converts UTF-8 to LaTeX
sub latex_encode {
my $text = shift;
- foreach my $type (keys %{$r_remaps->{$scheme_e}}) {
+ foreach my $type (sort keys %{$r_remaps->{$scheme_e}}) {
my $map = $r_remaps->{$scheme_e}{$type}{map};
my $re = $r_remaps->{$scheme_e}{$type}{re};
if ($type eq 'negatedsymbols') {
@@ -286,7 +286,7 @@ sub latex_encode {
}
}
- foreach my $type (keys %{$r_remaps->{$scheme_e}}) {
+ foreach my $type (sort keys %{$r_remaps->{$scheme_e}}) {
my $map = $r_remaps->{$scheme_e}{$type}{map};
my $re = $r_remaps->{$scheme_e}{$type}{re};
if ($type eq 'accents') {
@@ -318,7 +318,7 @@ sub latex_encode {
}
}
- foreach my $type (keys %{$r_remaps->{$scheme_e}}) {
+ foreach my $type (sort keys %{$r_remaps->{$scheme_e}}) {
my $map = $r_remaps->{$scheme_e}{$type}{map};
my $re = $r_remaps->{$scheme_e}{$type}{re};
if ($type eq 'wordmacros') {
diff --git t/full.t t/full.t
index 8df93c0..e278738 100755
--- t/full.t
+++ t/full.t
@@ -4,13 +4,22 @@ use warnings;
use utf8;
no warnings 'utf8';
-use Test::More tests => 5;
+use Test::More;
+
+if ($ENV{BIBER_DEV_TESTS}) {
+ plan tests => 5;
+}
+else {
+ plan skip_all => 'BIBER_DEV_TESTS not set';
+}
+
use IPC::Run3;
use IPC::Cmd qw( can_run );
use File::Temp;
use File::Compare;
use File::Which;
+
my $perl = which('perl');
my $tmpfile = File::Temp->new();
@@ -26,4 +35,3 @@ ok(compare($bbl, 't/tdata/full1.bbl') == 0, 'Testing lossort case and sortinit f
like($stdout, qr|WARN - Duplicate entry key: 'F1' in file 't/tdata/full\.bib', skipping \.\.\.|ms, 'Testing duplicate/case key warnings - 1');
like($stdout, qr|WARN - Possible typo \(case mismatch\) between datasource keys: 'f1' and 'F1' in file 't/tdata/full\.bib'|ms, 'Testing duplicate/case key warnings - 2');
like($stdout, qr|WARN - Possible typo \(case mismatch\) between citation and datasource keys: 'C1' and 'c1' in file 't/tdata/full\.bib'|ms, 'Testing duplicate/case key warnings - 3');
-
diff --git t/remote-files.t t/remote-files.t
index 61ab57f..8aab056 100755
--- t/remote-files.t
+++ t/remote-files.t
@@ -4,16 +4,20 @@ use warnings;
use utf8;
no warnings 'utf8' ;
-use Test::More tests => 3;
+use Test::More;
+
+if ($ENV{BIBER_DEV_TESTS}) {
+ plan tests => 3;
+}
+else {
+ plan skip_all => 'BIBER_DEV_TESTS not set';
+}
use Biber;
use Biber::Output::bbl;
use Log::Log4perl;
chdir("t/tdata") ;
-SKIP: {
- skip "BIBER_SKIP_DEV_TESTS env var is set, skipping remote tests", 3 if $ENV{BIBER_SKIP_DEV_TESTS};
-
# Set up Biber object
my $biber = Biber->new(noconf => 1);
my $LEVEL = 'ERROR';
@@ -140,5 +144,3 @@ my $ssl = q| \entry{jung_alchemical_????}{book}{}
is( $out->get_output_entry('citeulike:8283461', $main), $cu1, 'Fetch from citeulike') ;
is( $out->get_output_entry('AbdelbarH98', $main), $dl1, 'Fetch from plain bib download') ;
is( $out->get_output_entry('jung_alchemical_????', $main), $ssl, 'HTTPS test') ;
-
-}
diff --git t/tool-bltxml.t t/tool-bltxml.t
index ebd602a..72c30b1 100644
--- t/tool-bltxml.t
+++ t/tool-bltxml.t
@@ -57,57 +57,57 @@ my $bltxml1 = q|<?xml version="1.0" encoding="UTF-8"?>
<bltx:entries xmlns:bltx="http://biblatex-biber.sourceforge.net/biblatexml">
<bltx:entry id="i3Š" entrytype="unpublished">
- <bltx:author form="uniform" lang="lang">
+ <bltx:author>
<bltx:person>
<bltx:last>
- <bltx:namepart initial="a">aaa</bltx:namepart>
+ <bltx:namepart initial="A">AAA</bltx:namepart>
</bltx:last>
</bltx:person>
<bltx:person>
<bltx:last>
- <bltx:namepart initial="b">bbb</bltx:namepart>
+ <bltx:namepart initial="B">BBB</bltx:namepart>
</bltx:last>
</bltx:person>
<bltx:person>
<bltx:last>
- <bltx:namepart initial="c">ccc</bltx:namepart>
+ <bltx:namepart initial="C">CCC</bltx:namepart>
</bltx:last>
</bltx:person>
<bltx:person>
<bltx:last>
- <bltx:namepart initial="d">ddd</bltx:namepart>
+ <bltx:namepart initial="D">DDD</bltx:namepart>
</bltx:last>
</bltx:person>
<bltx:person>
<bltx:last>
- <bltx:namepart initial="e">eee</bltx:namepart>
+ <bltx:namepart initial="E">EEE</bltx:namepart>
</bltx:last>
</bltx:person>
</bltx:author>
- <bltx:author>
+ <bltx:author form="uniform" lang="lang">
<bltx:person>
<bltx:last>
- <bltx:namepart initial="A">AAA</bltx:namepart>
+ <bltx:namepart initial="a">aaa</bltx:namepart>
</bltx:last>
</bltx:person>
<bltx:person>
<bltx:last>
- <bltx:namepart initial="B">BBB</bltx:namepart>
+ <bltx:namepart initial="b">bbb</bltx:namepart>
</bltx:last>
</bltx:person>
<bltx:person>
<bltx:last>
- <bltx:namepart initial="C">CCC</bltx:namepart>
+ <bltx:namepart initial="c">ccc</bltx:namepart>
</bltx:last>
</bltx:person>
<bltx:person>
<bltx:last>
- <bltx:namepart initial="D">DDD</bltx:namepart>
+ <bltx:namepart initial="d">ddd</bltx:namepart>
</bltx:last>
</bltx:person>
<bltx:person>
<bltx:last>
- <bltx:namepart initial="E">EEE</bltx:namepart>
+ <bltx:namepart initial="e">eee</bltx:namepart>
</bltx:last>
</bltx:person>
</bltx:author>