On Sunday 22 May 2005 19:18, Torsten Foertsch wrote: > there is something wrong with APR::Base64. > > [EMAIL PROTECTED]:~> perl -MAPR::Base64 -MData::Dumper -e > '$x=APR::Base64::encode( "x" > ); print "$x\n".Dumper( [split "", $x] ), "length=".length($x)."\n";' eA== > $VAR1 = [ > 'e', > 'A', > '=', > '=', > '' > ]; > length=5 > [EMAIL PROTECTED]:~> perl -MAPR::Base64 -MData::Dumper -e > '$x=APR::Base64::encode( > "xxx" ); print "$x\n".Dumper( [split "", $x] ), "length=".length($x)."\n";' > eHh4 > $VAR1 = [ > 'e', > 'H', > 'h', > '4', > '' > ]; > length=5 > > In both cases length should be 4 and split("",$x) should return (qw(e a = > =)).
the attached t/lib/TestAPRlib/base64.pm fails on the bug: t/apr-ext/base64....1..3 # Running under perl version 5.008005 for linux # Current time local: Sun May 22 19:24:51 2005 # Current time GMT: Sun May 22 17:24:51 2005 # Using Test.pm version 1.25 # Using Apache/Test.pm version 1.25 # encoded string: MTIzNDVxd2VydCFAIyQl # testing : encode # expected: MTIzNDVxd2VydCFAIyQl # received: MTIzNDVxd2VydCFAIyQl not ok 1 # Failed test 1 in /usr/src/packages/BUILD/mod_perl-2.0.0/t/lib/TestAPRlib/base64.pm at line 23 # testing : encoded length # expected: 21 # received: 21 ok 2 # testing : decode # expected: [EMAIL PROTECTED] # received: [EMAIL PROTECTED] ok 3 FAILED test 1
base64.pm
Description: application/perl-module
pgpM8CY98boLZ.pgp
Description: PGP signature