diff options
author | Todd Rinaldo <toddr@cpan.org> | 2020-09-28 11:15:26 -0500 |
---|---|---|
committer | Todd Rinaldo <toddr@cpan.org> | 2020-09-28 12:58:09 -0500 |
commit | 90f582c2ef0c40b7fe74c27d2f03a4e6bb79a7e1 (patch) | |
tree | 911fcfbe9dff2e1128f8d55dfb1022dbc21b3e7b /cpan/MIME-Base64 | |
parent | 089cd0e7bc8532b03144cfc6ab13affaaf73840c (diff) | |
download | perl-90f582c2ef0c40b7fe74c27d2f03a4e6bb79a7e1.tar.gz |
Update MIME-Base64 to CPAN version 3.16
[DELTA]
3.16 2020-09-26
- Convert the build to Dist::Zilla to ensure we're releasing well built packages
- Ensure all tests are using strict and warnings (thanks, Nicolas R).
- Cleanup this change log
- Add a .mailmap to cleanup our contributors list
- Use `our` instead of `use vars`
- Bump the required Perl version to v5.6.2
Diffstat (limited to 'cpan/MIME-Base64')
-rw-r--r-- | cpan/MIME-Base64/Base64.xs | 6 | ||||
-rw-r--r-- | cpan/MIME-Base64/lib/MIME/Base64.pm (renamed from cpan/MIME-Base64/Base64.pm) | 10 | ||||
-rw-r--r-- | cpan/MIME-Base64/lib/MIME/QuotedPrint.pm (renamed from cpan/MIME-Base64/QuotedPrint.pm) | 8 | ||||
-rw-r--r-- | cpan/MIME-Base64/t/base64.t | 4 | ||||
-rw-r--r-- | cpan/MIME-Base64/t/base64url.t | 34 | ||||
-rw-r--r-- | cpan/MIME-Base64/t/length.t | 1 | ||||
-rw-r--r-- | cpan/MIME-Base64/t/quoted-print.t | 19 | ||||
-rw-r--r-- | cpan/MIME-Base64/t/unicode.t | 3 |
8 files changed, 62 insertions, 23 deletions
diff --git a/cpan/MIME-Base64/Base64.xs b/cpan/MIME-Base64/Base64.xs index 903aa211c1..308a75b038 100644 --- a/cpan/MIME-Base64/Base64.xs +++ b/cpan/MIME-Base64/Base64.xs @@ -25,16 +25,10 @@ metamail, which comes with this message: */ -#ifdef __cplusplus -extern "C" { -#endif #define PERL_NO_GET_CONTEXT /* we want efficiency */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" -#ifdef __cplusplus -} -#endif #define MAX_LINE 76 /* size of encoded lines */ diff --git a/cpan/MIME-Base64/Base64.pm b/cpan/MIME-Base64/lib/MIME/Base64.pm index 120cd72801..923c888da4 100644 --- a/cpan/MIME-Base64/Base64.pm +++ b/cpan/MIME-Base64/lib/MIME/Base64.pm @@ -1,14 +1,14 @@ package MIME::Base64; use strict; -use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION); +use warnings; require Exporter; -@ISA = qw(Exporter); -@EXPORT = qw(encode_base64 decode_base64); -@EXPORT_OK = qw(encode_base64url decode_base64url encoded_base64_length decoded_base64_length); +our @ISA = qw(Exporter); +our @EXPORT = qw(encode_base64 decode_base64); +our @EXPORT_OK = qw(encode_base64url decode_base64url encoded_base64_length decoded_base64_length); -$VERSION = '3.15'; +our $VERSION = '3.16'; require XSLoader; XSLoader::load('MIME::Base64', $VERSION); diff --git a/cpan/MIME-Base64/QuotedPrint.pm b/cpan/MIME-Base64/lib/MIME/QuotedPrint.pm index d0c71d1043..fe792ad30e 100644 --- a/cpan/MIME-Base64/QuotedPrint.pm +++ b/cpan/MIME-Base64/lib/MIME/QuotedPrint.pm @@ -1,13 +1,13 @@ package MIME::QuotedPrint; use strict; -use vars qw(@ISA @EXPORT $VERSION); +use warnings; require Exporter; -@ISA = qw(Exporter); -@EXPORT = qw(encode_qp decode_qp); +our @ISA = qw(Exporter); +our @EXPORT = qw(encode_qp decode_qp); -$VERSION = "3.13"; +our $VERSION = '3.16'; use MIME::Base64; # will load XS version of {en,de}code_qp() diff --git a/cpan/MIME-Base64/t/base64.t b/cpan/MIME-Base64/t/base64.t index d446ec25bf..ac702c2ece 100644 --- a/cpan/MIME-Base64/t/base64.t +++ b/cpan/MIME-Base64/t/base64.t @@ -1,3 +1,6 @@ +use strict; +use warnings; + BEGIN { if ($ENV{'PERL_CORE'}){ chdir 't' if -d 't'; @@ -5,7 +8,6 @@ BEGIN { } } -use strict; use MIME::Base64; print "1..283\n"; diff --git a/cpan/MIME-Base64/t/base64url.t b/cpan/MIME-Base64/t/base64url.t new file mode 100644 index 0000000000..9bb202defd --- /dev/null +++ b/cpan/MIME-Base64/t/base64url.t @@ -0,0 +1,34 @@ +#!perl -w + +use strict; +use warnings; +use Test qw(plan ok); + +use MIME::Base64 qw(encode_base64url decode_base64url); + +my @tests; +while (<DATA>) { + next if /^#/; + chomp; + push(@tests, [split]); +} + +plan tests => 2 * @tests; + +for (@tests) { + my($name, $input, $output) = @$_; + print "# $name\n"; + ok(decode_base64url($input), $output); + ok(encode_base64url($output), $input); +} + +__END__ +# https://github.com/ptarjan/base64url/blob/master/tests.txt +# Name <space> Input <space> Ouput <newline> +len1 YQ a +len2 YWE aa +len3 YWFh aaa +no_padding YWJj abc +padding YQ a +hyphen fn5- ~~~ +underscore Pz8_ ??? diff --git a/cpan/MIME-Base64/t/length.t b/cpan/MIME-Base64/t/length.t index 116838a7bb..f00dd832a9 100644 --- a/cpan/MIME-Base64/t/length.t +++ b/cpan/MIME-Base64/t/length.t @@ -1,6 +1,7 @@ #!perl -w use strict; +use warnings; use Test qw(plan ok); plan tests => 129; diff --git a/cpan/MIME-Base64/t/quoted-print.t b/cpan/MIME-Base64/t/quoted-print.t index 73c23016c7..0b4e53786a 100644 --- a/cpan/MIME-Base64/t/quoted-print.t +++ b/cpan/MIME-Base64/t/quoted-print.t @@ -1,3 +1,6 @@ +use strict; +use warnings; + BEGIN { if ($ENV{PERL_CORE}) { chdir 't' if -d 't'; @@ -7,10 +10,12 @@ BEGIN { use MIME::QuotedPrint; -$x70 = "x" x 70; +my $x70 = "x" x 70; + +my $IsASCII = ord('A') == 65; +my $IsEBCDIC = ord('A') == 193; -$IsASCII = ord('A') == 65; -$IsEBCDIC = ord('A') == 193; +my @tests; if ($IsASCII) { @@ -191,18 +196,18 @@ y. -- H. L. Mencken=\n"], die sprintf "Unknown character set: ord('A') == %d\n", ord('A'); } -$notests = @tests + 16; +my $notests = @tests + 16; print "1..$notests\n"; -$testno = 0; +my $testno = 0; for (@tests) { $testno++; - ($plain, $encoded) = @$_; + my ($plain, $encoded) = @$_; if (ord('A') == 193) { # EBCDIC 8 bit chars are different if ($testno == 2) { $plain =~ s/\xe5/\x47/; $plain =~ s/\xe6/\x9c/g; $plain =~ s/\xf8/\x70/; } if ($testno == 7) { $plain =~ s/\xff/\xdf/; } } - $x = encode_qp($plain); + my $x = encode_qp($plain); if ($x ne $encoded) { print "Encode test failed\n"; print "Got: '$x'\n"; diff --git a/cpan/MIME-Base64/t/unicode.t b/cpan/MIME-Base64/t/unicode.t index d6eba554eb..0ab70fb9be 100644 --- a/cpan/MIME-Base64/t/unicode.t +++ b/cpan/MIME-Base64/t/unicode.t @@ -1,3 +1,6 @@ +use strict; +use warnings; + BEGIN { unless ($] >= 5.006) { print "1..0\n"; |