File tree Expand file tree Collapse file tree 5 files changed +155
-279
lines changed
Expand file tree Collapse file tree 5 files changed +155
-279
lines changed Original file line number Diff line number Diff line change @@ -77,10 +77,6 @@ static const unsigned char index_64[256] = {
7777# define SvPVbyte SvPV
7878#endif
7979
80- #ifndef isXDIGIT
81- # define isXDIGIT isxdigit
82- #endif
83-
8480#ifndef NATIVE_TO_ASCII
8581# define NATIVE_TO_ASCII (ch ) (ch)
8682#endif
@@ -301,11 +297,7 @@ decoded_base64_length(sv)
301297
302298MODULE = MIME ::Base64 PACKAGE = MIME ::QuotedPrint
303299
304- #ifdef EBCDIC
305- #define qp_isplain (c ) ((c) == '\t' || ((!isprint(c) && (c) != '=')))
306- #else
307- #define qp_isplain (c ) ((c) == '\t' || (((c) >= ' ' && (c) <= '~') && (c) != '='))
308- #endif
300+ #define qp_isplain (c ) ((c) == '\t' || (isPRINT(c) && (c) != '='))
309301
310302SV *
311303encode_qp (sv ,...)
Original file line number Diff line number Diff line change @@ -18,9 +18,11 @@ BEGIN {
1818 if (ord (' A' ) == 0x41) {
1919 *ASCII = sub { return $_ [0] };
2020 }
21- else {
21+ else { # Translating to ASCII has the effect of showing that this test file
22+ # verifies that arbitrary binary input acts the same on both
23+ # platforms.
2224 require Encode;
23- *ASCII = sub { Encode::encode(' ascii' ,$_ [0]) };
25+ *ASCII = sub { return Encode::encode(' ascii' ,$_ [0]); };
2426 }
2527}
2628
Original file line number Diff line number Diff line change 22
33use strict;
44use warnings;
5- use Test qw( plan ok) ;
5+ use Test qw( plan ok skip ) ;
66
77use MIME::Base64 qw( encode_base64url decode_base64url) ;
88
99my @tests ;
10+
1011while (<DATA >) {
1112 next if / ^#/ ;
1213 chomp ;
@@ -18,8 +19,8 @@ plan tests => 2 * @tests;
1819for (@tests ) {
1920 my ($name , $input , $output ) = @$_ ;
2021 print " # $name \n " ;
21- ok( decode_base64url($input ), $output );
22- ok( encode_base64url($output ), $input );
22+ skip( ord ( " A " ) != 65 ? " ASCII-centric test " : 0, decode_base64url($input ), $output );
23+ skip( ord ( " A " ) != 65 ? " ASCII-centric test " : 0, encode_base64url($output ), $input );
2324}
2425
2526__END__
You can’t perform that action at this time.
0 commit comments