diff options
author | Karl Williamson <khw@cpan.org> | 2021-07-08 19:24:43 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-04-19 21:25:16 -0600 |
commit | 452a89a5e16a63b58183b09d724c3da332252f0a (patch) | |
tree | c7191871d56c02b83f8e3959dceab0122f789a7d | |
parent | 5649fc6ccaca547f488077f1a9383c149e5f87be (diff) | |
download | perl-452a89a5e16a63b58183b09d724c3da332252f0a.tar.gz |
podlators: Fixes for EBCDIC
-rw-r--r-- | cpan/podlators/t/man/empty.t | 3 | ||||
-rw-r--r-- | cpan/podlators/t/man/no-encode.t | 10 | ||||
-rw-r--r-- | cpan/podlators/t/text/invalid.t | 3 |
3 files changed, 11 insertions, 5 deletions
diff --git a/cpan/podlators/t/man/empty.t b/cpan/podlators/t/man/empty.t index cd0cfccc37..c38254e583 100644 --- a/cpan/podlators/t/man/empty.t +++ b/cpan/podlators/t/man/empty.t @@ -32,7 +32,8 @@ local $SIG{__WARN__} = sub { croak($_[0]) }; # Try a POD document where the only command is invalid. Make sure it succeeds # and doesn't throw an exception. ## no critic (ValuesAndExpressions::ProhibitEscapedCharacters) -ok(eval { $parser->parse_string_document("=\xa0") }, +my $invalid_char = chr utf8::unicode_to_native(0xa0); +ok(eval { $parser->parse_string_document("=$invalid_char") }, 'Parsed invalid document'); is($@, q{}, '...with no errors'); ## use critic diff --git a/cpan/podlators/t/man/no-encode.t b/cpan/podlators/t/man/no-encode.t index 199016217d..209509fb1b 100644 --- a/cpan/podlators/t/man/no-encode.t +++ b/cpan/podlators/t/man/no-encode.t @@ -38,14 +38,18 @@ BEGIN { # Ensure we don't get warnings by throwing an exception if we see any. This # is overridden below when we enable utf8 and do expect a warning. -local $SIG{__WARN__} = sub { die "No warnings expected\n" }; - +local $SIG{__WARN__} = sub { die join("\n", + "No warnings expected; instead got:", + @_); + }; # First, check that everything works properly when utf8 isn't set. We expect # to get accent-mangled ASCII output. Don't use Test::Podlators, since it # wants to import Encode. # ## no critic (ValuesAndExpressions::ProhibitEscapedCharacters) -my $pod = "=encoding latin1\n\n=head1 NAME\n\nBeyonc\xE9!"; +my $pod = "=encoding latin1\n\n=head1 NAME\n\nBeyonc" + . chr(utf8::unicode_to_native(0xE9)) + . "!"; my $parser = Pod::Man->new(utf8 => 0, name => 'test'); my $output; $parser->output_string(\$output); diff --git a/cpan/podlators/t/text/invalid.t b/cpan/podlators/t/text/invalid.t index 27a4e820fa..a9666e2501 100644 --- a/cpan/podlators/t/text/invalid.t +++ b/cpan/podlators/t/text/invalid.t @@ -55,7 +55,8 @@ sub check_document { # Document whose only content is an invalid command. ## no critic (ValuesAndExpressions::ProhibitEscapedCharacters) -check_document("=\xa0", 'invalid command'); +my $invalid_char = chr utf8::unicode_to_native(0xa0); +check_document("=$invalid_char", 'invalid command'); # Document containing only a =cut. check_document('=cut', 'document with only =cut'); |