"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ext/XS-APItest/t/svpv.t" between
perl-5.32.0-RC0.tar.xz and perl-5.32.0-RC1.tar.xz

About: Perl (Practical Extraction and Report Language) is a high-level, general-purpose, interpreted, dynamic programming language. Release candidate.

svpv.t  (perl-5.32.0-RC0.tar.xz):svpv.t  (perl-5.32.0-RC1.tar.xz)
#!perl -w #!perl -w
BEGIN { require 'charset_tools.pl'; }
use Test::More tests => 35; use Test::More tests => 35;
use XS::APItest; use XS::APItest;
for my $func ('SvPVbyte', 'SvPVutf8') { for my $func ('SvPVbyte', 'SvPVutf8') {
$g = *glob; $g = *glob;
$r = \1; $r = \1;
is &$func($g), '*main::glob', "$func(\$glob_copy)"; is &$func($g), '*main::glob', "$func(\$glob_copy)";
is ref\$g, 'GLOB', "$func(\$glob_copy) does not flatten the glob"; is ref\$g, 'GLOB', "$func(\$glob_copy) does not flatten the glob";
is &$func($r), "$r", "$func(\$ref)"; is &$func($r), "$r", "$func(\$ref)";
is ref\$r, 'REF', "$func(\$ref) does not flatten the ref"; is ref\$r, 'REF', "$func(\$ref) does not flatten the ref";
is &$func(*glob), '*main::glob', "$func(*glob)"; is &$func(*glob), '*main::glob', "$func(*glob)";
is ref\$::{glob}, 'GLOB', "$func(*glob) does not flatten the glob"; is ref\$::{glob}, 'GLOB', "$func(*glob) does not flatten the glob";
is &$func($^V), "$^V", "$func(\$ro_ref)"; is &$func($^V), "$^V", "$func(\$ro_ref)";
is ref\$^V, 'REF', "$func(\$ro_ref) does not flatten the ref"; is ref\$^V, 'REF', "$func(\$ro_ref) does not flatten the ref";
} }
my $data_bin = "\xC4\x8D"; my $B6 = byte_utf8a_to_utf8n("\xC2\xB6");
my $individual_B6_utf8_bytes = ($::IS_ASCII)
? "\xC3\x82\xC2\xB6"
: I8_to_native("\xC6\xB8\xC6\xA1");
my $data_bin = $B6;
utf8::downgrade($data_bin); utf8::downgrade($data_bin);
tie my $scalar_bin, 'TieScalarCounter', $data_bin; tie my $scalar_bin, 'TieScalarCounter', $data_bin;
do { my $fetch = $scalar_bin }; do { my $fetch = $scalar_bin };
is tied($scalar_bin)->{fetch}, 1; is tied($scalar_bin)->{fetch}, 1;
is tied($scalar_bin)->{store}, 0; is tied($scalar_bin)->{store}, 0;
is SvPVutf8_nomg($scalar_bin), "\xC3\x84\xC2\x8D"; is SvPVutf8_nomg($scalar_bin), $individual_B6_utf8_bytes;
is tied($scalar_bin)->{fetch}, 1; is tied($scalar_bin)->{fetch}, 1;
is tied($scalar_bin)->{store}, 0; is tied($scalar_bin)->{store}, 0;
is SvPVbyte_nomg($scalar_bin), "\xC4\x8D"; is SvPVbyte_nomg($scalar_bin), $B6;
is tied($scalar_bin)->{fetch}, 1; is tied($scalar_bin)->{fetch}, 1;
is tied($scalar_bin)->{store}, 0; is tied($scalar_bin)->{store}, 0;
my $data_uni = "\xC4\x8D"; my $data_uni = $B6;
utf8::upgrade($data_uni); utf8::upgrade($data_uni);
tie my $scalar_uni, 'TieScalarCounter', $data_uni; tie my $scalar_uni, 'TieScalarCounter', $data_uni;
do { my $fetch = $scalar_uni }; do { my $fetch = $scalar_uni };
is tied($scalar_uni)->{fetch}, 1; is tied($scalar_uni)->{fetch}, 1;
is tied($scalar_uni)->{store}, 0; is tied($scalar_uni)->{store}, 0;
is SvPVbyte_nomg($scalar_uni), "\xC4\x8D"; is SvPVbyte_nomg($scalar_uni), $B6;
is tied($scalar_uni)->{fetch}, 1; is tied($scalar_uni)->{fetch}, 1;
is tied($scalar_uni)->{store}, 0; is tied($scalar_uni)->{store}, 0;
is SvPVutf8_nomg($scalar_uni), "\xC3\x84\xC2\x8D"; is SvPVutf8_nomg($scalar_uni), $individual_B6_utf8_bytes;
is tied($scalar_uni)->{fetch}, 1; is tied($scalar_uni)->{fetch}, 1;
is tied($scalar_uni)->{store}, 0; is tied($scalar_uni)->{store}, 0;
eval 'SvPVbyte(*{chr 256})'; eval 'SvPVbyte(*{chr 256})';
like $@, qr/^Wide character/, 'SvPVbyte fails on Unicode glob'; like $@, qr/^Wide character/, 'SvPVbyte fails on Unicode glob';
package r { use overload '""' => sub { substr "\x{100}\xff", -1 } } package r { use overload '""' => sub { substr "\x{100}\xff", -1 } }
is SvPVbyte(bless [], r::), "\xff", is SvPVbyte(bless [], r::), "\xff",
'SvPVbyte on ref returning downgradable utf8 string'; 'SvPVbyte on ref returning downgradable utf8 string';
sub TIESCALAR { bless \(my $thing = pop), shift } sub TIESCALAR { bless \(my $thing = pop), shift }
 End of changes. 7 change blocks. 
6 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)