In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/6bbe4a241408a4d32e8e356d9c48809bc1f69d14?hp=adbaea0b31df5572c6a4595494a64bd6578e0f5c>
- Log ----------------------------------------------------------------- commit 6bbe4a241408a4d32e8e356d9c48809bc1f69d14 Author: Karl Williamson <[email protected]> Date: Thu Jun 7 12:28:54 2012 -0600 UCD.t: Cope with $/ being set. These tests fail in some earlier Unicode versions because $/ is being set. Reset it to $/ around the reads and chomps this .t does. M lib/Unicode/UCD.t commit 4f1530fd110546b80082748710520b3e7b06ac8f Author: Karl Williamson <[email protected]> Date: Mon Jun 4 09:08:19 2012 -0600 Revert "UCD.t: Don't use BEL for $/" This reverts commit 9a8e4a54f8b3668a7ebd8f229cdfb405a1dce77c. It turns out that the reason this was there was to add a stress test. Outside setting of $/ should not break Unicode::UCD M lib/Unicode/UCD.t commit f39c755e3c68443fc7acf379625e9eba42d6bfd3 Author: Karl Williamson <[email protected]> Date: Mon Jun 4 09:06:07 2012 -0600 mktables: Use initialize instead of a push The code later on used to be done only sometimes; now that it is executed always, some of it can be done at initialization time. M lib/unicore/mktables ----------------------------------------------------------------------- Summary of changes: lib/Unicode/UCD.t | 22 +++++++++++++++++++++- lib/unicore/mktables | 4 +--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/lib/Unicode/UCD.t b/lib/Unicode/UCD.t index 9cf235d..8f93212 100644 --- a/lib/Unicode/UCD.t +++ b/lib/Unicode/UCD.t @@ -19,6 +19,9 @@ use Test::More; use Unicode::UCD 'charinfo'; +my $input_record_separator = 7; # Make sure Unicode::UCD isn't affected by +$/ = $input_record_separator; # setting this. + my $charinfo; is(charinfo(0x110000), undef, "Verify charinfo() of non-unicode is undef"); @@ -555,12 +558,13 @@ SKIP: { skip "PropertyAliases.txt is not in this Unicode version", 1 if $v_unicode_version lt v3.2.0; open my $props, "<", "../lib/unicore/PropertyAliases.txt" or die "Can't open Unicode PropertyAliases.txt"; -$/ = "\n"; +local $/ = "\n"; while (<$props>) { s/\s*#.*//; # Remove comments next if /^\s* $/x; # Ignore empty and comment lines chomp; + local $/ = $input_record_separator; my $count = 0; # 0th field in line is short name; 1th is long name my $short_name; my $full_name; @@ -710,10 +714,12 @@ SKIP: { skip "PropValueAliases.txt is not in this Unicode version", 1 if $v_unicode_version lt v3.2.0; open my $propvalues, "<", "../lib/unicore/PropValueAliases.txt" or die "Can't open Unicode PropValueAliases.txt"; +local $/ = "\n"; while (<$propvalues>) { s/\s*#.*//; # Remove comments next if /^\s* $/x; # Ignore empty and comment lines chomp; + local $/ = $input_record_separator; # Fix typo in official input file s/CCC133/CCC132/g if $v_unicode_version eq v6.1.0; @@ -961,6 +967,7 @@ sub fail_with_diff ($$$$) { require File::Temp; my $off = File::Temp->new(); + local $/ = "\n"; chomp $official; print $off $official, "\n"; close $off || die "Can't close official"; @@ -1045,7 +1052,9 @@ foreach my $set_of_tables (\%utf8::stricter_to_file_of, \%utf8::loose_to_file_of # Get rid of any trailing space and comments in the file. $official =~ s/\s*(#.*)?$//mg; + local $/ = "\n"; chomp $official; + $/ = $input_record_separator; # If we are to test against an inverted file, it is easier to invert # our array than the file. @@ -1099,7 +1108,9 @@ foreach my $set_of_tables (\%utf8::stricter_to_file_of, \%utf8::loose_to_file_of if ($i == @tested - 1 && $tested[$i] <= 0x10FFFF) { $tested .= sprintf("%04X\t10FFFF\n", $tested[$i]); } + local $/ = "\n"; chomp $tested; + $/ = $input_record_separator; if ($tested ne $official) { fail_with_diff($mod_table, $official, $tested, "prop_invlist"); next; @@ -1415,7 +1426,9 @@ foreach my $prop (keys %props) { } } } + local $/ = "\n"; chomp $official; + $/ = $input_record_separator; # Get the format for the file, and if there are any special elements, # get a reference to them. @@ -1742,7 +1755,9 @@ foreach my $prop (keys %props) { # Here are done with generating what the file should look like + local $/ = "\n"; chomp $tested_map; + $/ = $input_record_separator; # And compare. if ($tested_map ne $official) { @@ -1812,7 +1827,9 @@ foreach my $prop (keys %props) { $official =~ s/$hex_code_point \t $alias \n //x; } } + local $/ = "\n"; chomp $official; + $/ = $input_record_separator; # Here have adjusted the file. We also have to adjust the returned # inversion map by checking and deleting all the lines in it that @@ -1900,7 +1917,9 @@ foreach my $prop (keys %props) { # Finished creating the string from the inversion map. Can compare # with what the file is. + local $/ = "\n"; chomp $tested_map; + $/ = $input_record_separator; if ($tested_map ne $official) { fail_with_diff($mod_prop, $official, $tested_map, "prop_invmap"); next PROPERTY; @@ -2007,4 +2026,5 @@ foreach my $prop (keys %props) { pass("prop_invmap('$mod_prop')"); } +ok($/ eq $input_record_separator, "The record separator didn't get overridden"); done_testing(); diff --git a/lib/unicore/mktables b/lib/unicore/mktables index 3b377f5..796e14c 100644 --- a/lib/unicore/mktables +++ b/lib/unicore/mktables @@ -13495,8 +13495,7 @@ sub compile_perl() { $lv_lvt_v += $gcb->table('LV') + $gcb->table('LVT') + $gcb->table('V'); $lv_lvt_v->add_comment('For use in \X; matches: hst=LV | hst=LVT | hst=V'); - # Was earlier constructed to contain both Name and Unicode_1_Name - my @composition = ('Name', 'Unicode_1_Name'); + my @composition = ('Name', 'Unicode_1_Name', 'Name_Alias'); if (@named_sequences) { push @composition, 'Named_Sequence'; @@ -13508,7 +13507,6 @@ sub compile_perl() { my $alias_sentence = ""; my %abbreviations; my $alias = property_ref('Name_Alias'); - push @composition, 'Name_Alias'; $perl_charname->set_proxy_for('Name_Alias'); # Add each entry in Name_Alias to Perl_Charnames. Where these go with -- Perl5 Master Repository
