Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-Encode for openSUSE:Factory checked in at 2022-04-14 17:25:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Encode (Old) and /work/SRC/openSUSE:Factory/.perl-Encode.new.1941 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Encode" Thu Apr 14 17:25:18 2022 rev:21 rq:969984 version:3.17 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Encode/perl-Encode.changes 2021-10-23 00:52:15.229155192 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Encode.new.1941/perl-Encode.changes 2022-04-14 17:25:52.343291925 +0200 @@ -1,0 +2,6 @@ +Fri Apr 8 03:06:19 UTC 2022 - Tina M??ller <[email protected]> + +- updated to 3.17 + see /usr/share/doc/packages/perl-Encode/Changes + +------------------------------------------------------------------- Old: ---- Encode-3.16.tar.gz New: ---- Encode-3.17.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Encode.spec ++++++ --- /var/tmp/diff_new_pack.g8N2Hn/_old 2022-04-14 17:25:52.875292547 +0200 +++ /var/tmp/diff_new_pack.g8N2Hn/_new 2022-04-14 17:25:52.879292552 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-Encode # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,10 +18,10 @@ %define cpan_name Encode Name: perl-Encode -Version: 3.16 +Version: 3.17 Release: 0 -Summary: Character encodings in Perl License: Artistic-1.0 OR GPL-1.0-or-later +Summary: Character encodings in Perl URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/D/DA/DANKOGAI/%{cpan_name}-%{version}.tar.gz Source1: perl-Encode-rpmlintrc ++++++ Encode-3.16.tar.gz -> Encode-3.17.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Encode-3.16/Changes new/Encode-3.17/Changes --- old/Encode-3.16/Changes 2021-10-13 10:29:16.000000000 +0200 +++ new/Encode-3.17/Changes 2022-04-07 05:06:43.000000000 +0200 @@ -1,11 +1,28 @@ # Revision history for Perl extension Encode. # -# $Id: Changes,v 3.16 2021/10/13 08:29:13 dankogai Exp dankogai $ +# $Id: Changes,v 3.17 2022/04/07 03:06:40 dankogai Exp dankogai $ # -$Revision: 3.16 $ $Date: 2021/10/13 08:29:13 $ +$Revision: 3.17 $ $Date: 2022/04/07 03:06:40 $ +! bin/enc2xs t/enc_data.t t/enc_module.t t/encoding.t t/jperl.t + Pulled: Fix Issue #144, spurious warnings from -Wc++-compate, + and a few related nits + https://github.com/dankogai/p5-encode/pull/168 +! MANIFEST + add t/utf32warnings.t which was missing +! t/taint.t + Pulled: Skip taint tests if your perl was built without taint support + https://github.com/dankogai/p5-encode/pull/167 +! Unicode/Unicode.pm + Pulled: fix link to Unicode standard + https://github.com/dankogai/p5-encode/pull/165 +! t/Unicode_trailing_nul.t + Pulled: Use note() instead of diag() + https://github.com/dankogai/p5-encode/pull/164 + +3.16 2021/10/13 08:29:13 ! Makefile.PL Pulled: Only add -Werror=declaration-after-statement for 5.035004 and earlier - https://github.com/dankogai/p5-encode/pull/162/filehttps://github.com/dankogai/p5-encode/pull/162 + https://github.com/dankogai/p5-encode/pull/162 3.15 2021/10/08 15:29:23 ! Encode.xs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Encode-3.16/Encode.pm new/Encode-3.17/Encode.pm --- old/Encode-3.16/Encode.pm 2021-10-13 10:29:16.000000000 +0200 +++ new/Encode-3.17/Encode.pm 2022-04-07 05:06:43.000000000 +0200 @@ -1,5 +1,5 @@ # -# $Id: Encode.pm,v 3.16 2021/10/13 08:29:04 dankogai Exp $ +# $Id: Encode.pm,v 3.17 2022/04/07 03:05:51 dankogai Exp $ # package Encode; use strict; @@ -7,7 +7,7 @@ use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG}; our $VERSION; BEGIN { - $VERSION = sprintf "%d.%02d", q$Revision: 3.16 $ =~ /(\d+)/g; + $VERSION = sprintf "%d.%02d", q$Revision: 3.17 $ =~ /(\d+)/g; require XSLoader; XSLoader::load( __PACKAGE__, $VERSION ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Encode-3.16/MANIFEST new/Encode-3.17/MANIFEST --- old/Encode-3.16/MANIFEST 2021-10-13 10:37:12.000000000 +0200 +++ new/Encode-3.17/MANIFEST 2022-04-07 05:15:35.000000000 +0200 @@ -112,6 +112,7 @@ t/undef.t test script t/unibench.pl benchmark script t/use-Encode-Alias.t test script +t/utf32warnings.t test script t/utf8ref.t test script t/utf8strict.t test script t/utf8warnings.t test script diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Encode-3.16/META.json new/Encode-3.17/META.json --- old/Encode-3.16/META.json 2021-10-13 10:37:12.000000000 +0200 +++ new/Encode-3.17/META.json 2022-04-07 05:15:35.000000000 +0200 @@ -49,7 +49,7 @@ "url" : "https://github.com/dankogai/p5-encode" } }, - "version" : "3.16", + "version" : "3.17", "x_contributors" : [ "Alex Davies <[email protected]>", "Alex Kapranoff <[email protected]>", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Encode-3.16/META.yml new/Encode-3.17/META.yml --- old/Encode-3.16/META.yml 2021-10-13 10:37:12.000000000 +0200 +++ new/Encode-3.17/META.yml 2022-04-07 05:15:35.000000000 +0200 @@ -24,7 +24,7 @@ parent: '0.221' resources: repository: https://github.com/dankogai/p5-encode -version: '3.16' +version: '3.17' x_contributors: - 'Alex Davies <[email protected]>' - 'Alex Kapranoff <[email protected]>' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Encode-3.16/Makefile.PL new/Encode-3.17/Makefile.PL --- old/Encode-3.16/Makefile.PL 2021-10-13 10:29:19.000000000 +0200 +++ new/Encode-3.17/Makefile.PL 2022-04-07 05:06:46.000000000 +0200 @@ -1,5 +1,5 @@ # -# $Id: Makefile.PL,v 2.24 2021/10/13 08:29:13 dankogai Exp dankogai $ +# $Id: Makefile.PL,v 2.24 2021/10/13 08:29:13 dankogai Exp $ # use 5.007003; use strict; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Encode-3.16/Unicode/Unicode.pm new/Encode-3.17/Unicode/Unicode.pm --- old/Encode-3.16/Unicode/Unicode.pm 2021-10-13 10:29:19.000000000 +0200 +++ new/Encode-3.17/Unicode/Unicode.pm 2022-04-07 05:06:49.000000000 +0200 @@ -3,7 +3,7 @@ use strict; use warnings; -our $VERSION = do { my @r = ( q$Revision: 2.19 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +our $VERSION = do { my @r = ( q$Revision: 2.20 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; use XSLoader; XSLoader::load( __PACKAGE__, $VERSION ); @@ -170,7 +170,7 @@ When BE or LE is omitted during decode(), it checks if BOM is at the beginning of the string; if one is found, the endianness is set to -what the BOM says. +what the BOM says. =item * @@ -258,15 +258,15 @@ =head1 SEE ALSO -L<Encode>, L<Encode::Unicode::UTF7>, L<http://www.unicode.org/glossary/>, -L<http://www.unicode.org/faq/utf_bom.html>, +L<Encode>, L<Encode::Unicode::UTF7>, L<https://www.unicode.org/glossary/>, +L<https://www.unicode.org/faq/utf_bom.html>, RFC 2781 L<http://www.ietf.org/rfc/rfc2781.txt>, -The whole Unicode standard L<http://www.unicode.org/unicode/uni2book/u2.html> +The whole Unicode standard L<https://www.unicode.org/standard/standard.html> -Ch. 15, pp. 403 of C<Programming Perl (3rd Edition)> -by Larry Wall, Tom Christiansen, Jon Orwant; -O'Reilly & Associates; ISBN 0-596-00027-8 +Ch. 6 pp. 275 of C<Programming Perl (3rd Edition)> +by Tom Christiansen, brian d foy & Larry Wall; +O'Reilly & Associates; ISBN 978-0-596-00492-7 =cut diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Encode-3.16/bin/enc2xs new/Encode-3.17/bin/enc2xs --- old/Encode-3.16/bin/enc2xs 2021-10-13 10:29:19.000000000 +0200 +++ new/Encode-3.17/bin/enc2xs 2022-04-07 05:06:52.000000000 +0200 @@ -11,7 +11,7 @@ use Getopt::Std; use Config; my @orig_ARGV = @ARGV; -our $VERSION = do { my @r = (q$Revision: 2.23 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +our $VERSION = do { my @r = (q$Revision: 2.24 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; # These may get re-ordered. # RAW is a do_now as inserted by &enter @@ -249,7 +249,12 @@ END } - if ($cname =~ /(\w+)\.xs$/) + if ($cname =~ /\.c$/i && $Config{ccname} eq "gcc") + { + print C qq(#pragma GCC diagnostic ignored "-Wc++-compat"\n); + } + + if ($cname =~ /\.xs$/i) { print C "#define PERL_NO_GET_CONTEXT\n"; print C "#include <EXTERN.h>\n"; @@ -259,15 +264,15 @@ print C "#include \"encode.h\"\n\n"; } -elsif ($cname =~ /\.enc$/) +elsif ($cname =~ /\.enc$/i) { $doEnc = 1; } -elsif ($cname =~ /\.ucm$/) +elsif ($cname =~ /\.ucm$/i) { $doUcm = 1; } -elsif ($cname =~ /\.pet$/) +elsif ($cname =~ /\.pet$/i) { $doPet = 1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Encode-3.16/t/Unicode_trailing_nul.t new/Encode-3.17/t/Unicode_trailing_nul.t --- old/Encode-3.16/t/Unicode_trailing_nul.t 2021-07-08 17:54:34.000000000 +0200 +++ new/Encode-3.17/t/Unicode_trailing_nul.t 2021-12-07 16:11:54.000000000 +0100 @@ -12,7 +12,7 @@ my ($fh, $path) = File::Temp::tempfile( CLEANUP => 1 ); -diag "temp file: $path"; +note "temp file: $path"; # Perl gives the internal PV to exec .. which is buggy/wrong but # useful here: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Encode-3.16/t/enc_data.t new/Encode-3.17/t/enc_data.t --- old/Encode-3.16/t/enc_data.t 2021-10-13 10:29:19.000000000 +0200 +++ new/Encode-3.17/t/enc_data.t 2022-04-07 05:06:55.000000000 +0200 @@ -1,4 +1,4 @@ -# $Id: enc_data.t,v 2.5 2016/11/29 23:29:23 dankogai Exp $ +# $Id: enc_data.t,v 2.6 2022/04/07 03:06:40 dankogai Exp dankogai $ BEGIN { require Config; import Config; @@ -15,7 +15,7 @@ exit(0); } if ($] >= 5.025 and !$Config{usecperl}) { - print "1..0 # Skip: encoding pragma not supported in Perl 5.26\n"; + print "1..0 # Skip: encoding pragma not supported in Perl 5.25 or later\n"; exit(0); } if ($] <= 5.008 and !$Config{perl_patchlevel}){ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Encode-3.16/t/enc_module.t new/Encode-3.17/t/enc_module.t --- old/Encode-3.16/t/enc_module.t 2021-10-13 10:29:19.000000000 +0200 +++ new/Encode-3.17/t/enc_module.t 2022-04-07 05:06:56.000000000 +0200 @@ -1,4 +1,4 @@ -# $Id: enc_module.t,v 2.5 2016/11/29 23:29:23 dankogai Exp $ +# $Id: enc_module.t,v 2.6 2022/04/07 03:06:40 dankogai Exp dankogai $ # This file is in euc-jp BEGIN { require Config; import Config; @@ -19,7 +19,7 @@ exit(0); } if ($] >= 5.025 and !$Config{usecperl}) { - print "1..0 # Skip: encoding pragma not supported in Perl 5.26\n"; + print "1..0 # Skip: encoding pragma not supported in Perl 5.25 or later\n"; exit(0); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Encode-3.16/t/encoding.t new/Encode-3.17/t/encoding.t --- old/Encode-3.16/t/encoding.t 2016-11-30 00:05:16.000000000 +0100 +++ new/Encode-3.17/t/encoding.t 2022-04-07 04:59:51.000000000 +0200 @@ -13,7 +13,7 @@ exit(0); } if ($] >= 5.025 and !$Config{usecperl}) { - print "1..0 # Skip: encoding pragma not supported in Perl 5.26\n"; + print "1..0 # Skip: encoding pragma not supported in Perl 5.25 or later\n"; exit(0); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Encode-3.16/t/jperl.t new/Encode-3.17/t/jperl.t --- old/Encode-3.16/t/jperl.t 2021-10-13 10:29:19.000000000 +0200 +++ new/Encode-3.17/t/jperl.t 2022-04-07 05:06:58.000000000 +0200 @@ -1,5 +1,5 @@ # -# $Id: jperl.t,v 2.5 2016/11/29 23:29:23 dankogai Exp $ +# $Id: jperl.t,v 2.6 2022/04/07 03:06:40 dankogai Exp dankogai $ # # This script is written in euc-jp @@ -18,7 +18,7 @@ exit 0; } if ($] >= 5.025 and !$Config{usecperl}) { - print "1..0 # Skip: encoding pragma not supported in Perl 5.26\n"; + print "1..0 # Skip: encoding pragma not supported in Perl 5.25 or later\n"; exit(0); } $| = 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Encode-3.16/t/taint.t new/Encode-3.17/t/taint.t --- old/Encode-3.16/t/taint.t 2016-11-30 00:07:13.000000000 +0100 +++ new/Encode-3.17/t/taint.t 2022-03-07 09:52:25.000000000 +0100 @@ -4,6 +4,7 @@ local %Encode::ExtModule = %Encode::Config::ExtModule; use Scalar::Util qw(tainted); use Test::More; +use Config; my $taint = substr($ENV{PATH},0,0); my $str = "dan\x{5f3e}" . $taint; # tainted string to encode my $bin = encode('UTF-8', $str); # tainted binary to decode @@ -11,7 +12,12 @@ my $notaint_str = "dan\x{5f3e}" . $notaint; my $notaint_bin = encode('UTF-8', $notaint_str); my @names = Encode->encodings(':all'); -plan tests => 4 * @names + 2; +if (exists($Config{taint_support}) && not $Config{taint_support}) { + plan skip_all => "your perl was built without taint support"; +} +else { + plan tests => 4 * @names + 2; +} for my $name (@names) { my ($d, $e, $s); eval { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Encode-3.16/t/utf32warnings.t new/Encode-3.17/t/utf32warnings.t --- old/Encode-3.16/t/utf32warnings.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Encode-3.17/t/utf32warnings.t 2018-06-28 13:28:27.000000000 +0200 @@ -0,0 +1,277 @@ +use strict; +use warnings; + +my $script = quotemeta $0; + +use Encode; +use Test::More tests => 38; + +my $valid = "\x61\x00\x00\x00"; +my $invalid = "\x78\x56\x34\x12"; + +our $warn; +$SIG{__WARN__} = sub { $warn = $_[0] }; + +my $enc = find_encoding("UTF32-LE"); + +{ + local $warn; + my $ret = $enc->encode( "a", Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Calling encode on UTF32-LE encode object with valid string produces no warnings"); + is($ret, $valid, "Calling encode on UTF32-LE encode object with valid string returns correct output"); +} + + +{ + local $warn; + $enc->encode( "\x{D800}", Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + like($warn, qr/UTF-16 surrogate.* at $script line /, "Calling encode on UTF32-LE encode object with invalid string warns"); +} + +{ + local $warn; + no warnings 'utf8'; + $enc->encode( "\x{D800}", Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Warning from encode method of UTF32-LE encode object can be silenced via no warnings 'utf8'"); +} + +{ + local $warn; + no warnings; + $enc->encode( "\x{D800}", Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Warning from encode method of UTF32-LE encode object can be silenced via no warnings"); +} + +{ + local $warn; + no warnings 'utf8'; + $enc->encode( "\x{D800}", Encode::WARN_ON_ERR | Encode::LEAVE_SRC ); + like($warn, qr/UTF-16 surrogate.* at $script line /, "Warning from encode method of UTF32-LE encode object cannot be silenced via no warnings 'utf8' when ONLY_PRAGMA_WARNINGS is not used"); +} + +{ + local $warn; + no warnings; + $enc->encode( "\x{D800}", Encode::WARN_ON_ERR | Encode::LEAVE_SRC ); + like($warn, qr/UTF-16 surrogate.* at $script line /, "Warning from encode method of UTF32-LE encode object cannot be silenced via no warnings when ONLY_PRAGMA_WARNINGS is not used"); +} + + +{ + local $warn; + my $ret = Encode::encode( $enc, "a", Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Calling Encode::encode for UTF32-LE with valid string produces no warnings"); + is($ret, $valid, "Calling Encode::encode for UTF32-LE with valid string returns correct output"); +} + + +{ + local $warn; + Encode::encode( $enc, "\x{D800}", Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + like($warn, qr/UTF-16 surrogate.* at $script line /, "Calling Encode::encode for UTF32-LE with invalid string warns"); +} + + +{ + local $warn; + no warnings 'utf8'; + Encode::encode( $enc, "\x{D800}", Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Warning from Encode::encode for UTF32-LE can be silenced via no warnings 'utf8'"); +} + +{ + local $warn; + no warnings; + Encode::encode( $enc, "\x{D800}", Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Warning from Encode::encode for UTF32-LE can be silenced via no warnings"); +} + +{ + local $warn; + no warnings 'utf8'; + Encode::encode( $enc, "\x{D800}", Encode::WARN_ON_ERR | Encode::LEAVE_SRC ); + like($warn, qr/UTF-16 surrogate.* at $script line /, "Warning from Encode::encode for UTF32-LE cannot be silenced via no warnings 'utf8' when ONLY_PRAGMA_WARNINGS is not used"); +} + +{ + local $warn; + no warnings; + Encode::encode( $enc, "\x{D800}", Encode::WARN_ON_ERR | Encode::LEAVE_SRC ); + like($warn, qr/UTF-16 surrogate.* at $script line /, "Warning from Encode::encode for UTF32-LE cannot be silenced via no warnings when ONLY_PRAGMA_WARNINGS is not used"); +} + + +{ + local $warn; + my $ret = $enc->decode( $valid, Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Calling decode on UTF32-LE encode object with valid string produces no warnings"); + is($ret, "a", "Calling decode on UTF32-LE encode object with valid string returns correct output"); +} + + +{ + local $warn; + $enc->decode( $invalid, Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + like($warn, qr/may not be portable.* at $script line /, "Calling decode on UTF32-LE encode object with invalid string warns"); +} + +{ + local $warn; + no warnings 'utf8'; + $enc->decode( $invalid, Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Warning from decode method of UTF32-LE encode object can be silenced via no warnings 'utf8'"); +} + +{ + local $warn; + no warnings; + $enc->decode( $invalid, Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Warning from decode method of UTF32-LE encode object can be silenced via no warnings"); +} + +{ + local $warn; + no warnings 'utf8'; + $enc->decode( $invalid, Encode::WARN_ON_ERR | Encode::LEAVE_SRC ); + like($warn, qr/may not be portable.* at $script line /, "Warning from decode method of UTF32-LE encode object cannot be silenced via no warnings 'utf8' when ONLY_PRAGMA_WARNINGS is not used"); +} + +{ + local $warn; + no warnings; + $enc->decode( $invalid, Encode::WARN_ON_ERR | Encode::LEAVE_SRC ); + like($warn, qr/may not be portable.* at $script line /, "Warning from decode method of UTF32-LE encode object cannot be silenced via no warnings when ONLY_PRAGMA_WARNINGS is not used"); +} + + +{ + local $warn; + my $ret = Encode::decode( $enc, $valid, Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Calling Encode::decode for UTF32-LE with valid string produces no warnings"); + is($ret, "a", "Calling Encode::decode for UTF32-LE with valid string returns correct output"); +} + + +{ + local $warn; + Encode::decode( $enc, $invalid, Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + like($warn, qr/may not be portable.* at $script line /, "Calling Encode::decode for UTF32-LE with invalid string warns"); +} + +{ + local $warn; + no warnings 'utf8'; + Encode::decode( $enc, $invalid, Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Warning from Encode::decode for UTF32-LE can be silenced via no warnings 'utf8'"); +} + +{ + local $warn; + no warnings; + Encode::decode( $enc, $invalid, Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Warning from Encode::decode for UTF32-LE can be silenced via no warnings"); +} + +{ + local $warn; + no warnings 'utf8'; + Encode::decode( $enc, $invalid, Encode::WARN_ON_ERR | Encode::LEAVE_SRC ); + like($warn, qr/may not be portable.* at $script line /, "Warning from Encode::decode for UTF32-LE cannot be silenced via no warnings 'utf8' when ONLY_PRAGMA_WARNINGS is not used"); +} + +{ + local $warn; + no warnings; + Encode::decode( $enc, $invalid, Encode::WARN_ON_ERR | Encode::LEAVE_SRC ); + like($warn, qr/may not be portable.* at $script line /, "Warning from Encode::decode for UTF32-LE cannot be silenced via no warnings when ONLY_PRAGMA_WARNINGS is not used"); +} + + +use PerlIO::encoding; +$PerlIO::encoding::fallback |= Encode::ONLY_PRAGMA_WARNINGS; + +{ + local $warn; + my $tmp = $valid; + $tmp .= ''; # de-COW + open my $fh, '<:encoding(UTF32-LE)', \$tmp or die; + my $str = <$fh>; + close $fh; + is($warn, undef, "Calling PerlIO :encoding on valid string produces no warnings"); + is($str, "a", "PerlIO decodes string correctly"); +} + + +{ + local $warn; + my $tmp = $invalid; + use Devel::Peek; + $tmp .= ''; # de-COW + open my $fh, '<:encoding(UTF32-LE)', \$tmp or die; + my $str = <$fh>; + close $fh; + like($warn, qr/may not be portable.* at $script line /, "Calling PerlIO :encoding on invalid string warns"); +} + +{ + local $warn; + my $tmp = $invalid; + $tmp .= ''; # de-COW + no warnings 'utf8'; + open my $fh, '<:encoding(UTF32-LE)', \$tmp or die; + my $str = <$fh>; + close $fh; + is($warn, undef, "Warning from PerlIO :encoding can be silenced via no warnings 'utf8'"); +} + +{ + local $warn; + my $tmp = $invalid; + $tmp .= ''; # de-COW + no warnings; + open my $fh, '<:encoding(UTF32-LE)', \$tmp or die; + my $str = <$fh>; + close $fh; + is($warn, undef, "Warning from PerlIO :encoding can be silenced via no warnings"); +} + + +{ + local $warn; + my $str; + open my $fh, '>:encoding(UTF32-LE)', \$str or die; + print $fh "a"; + close $fh; + is($warn, undef, "Calling PerlIO :encoding on valid string produces no warnings"); + is($str, $valid, "PerlIO encodes string correctly"); +} + + +{ + local $warn; + my $str; + open my $fh, '>:encoding(UTF32-LE)', \$str or die; + print $fh "\x{D800}"; + close $fh; + like($warn, qr/UTF-16 surrogate.* at $script line /, "Calling PerlIO :encoding on invalid string warns"); +} + +{ + local $warn; + my $str; + no warnings 'utf8'; + open my $fh, '>:encoding(UTF32-LE)', \$str or die; + print $fh "\x{D800}"; + close $fh; + is($warn, undef, "Warning from PerlIO :encoding can be silenced via no warnings 'utf8'"); +} + +{ + local $warn; + my $str; + no warnings; + open my $fh, '>:encoding(UTF32-LE)', \$str or die; + print $fh "\x{D800}"; + close $fh; + is($warn, undef, "Warning from PerlIO :encoding can be silenced via no warnings"); +}
