r64056 - in /trunk/libtext-csv-perl: Changes META.yml README debian/changelog lib/Text/CSV.pm lib/Text/CSV_PP.pm t/71_pp.t
carnil at users.alioth.debian.org
carnil at users.alioth.debian.org
Wed Oct 20 14:13:33 UTC 2010
Author: carnil
Date: Wed Oct 20 14:13:08 2010
New Revision: 64056
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=64056
Log:
New upstream release
Modified:
trunk/libtext-csv-perl/Changes
trunk/libtext-csv-perl/META.yml
trunk/libtext-csv-perl/README
trunk/libtext-csv-perl/debian/changelog
trunk/libtext-csv-perl/lib/Text/CSV.pm
trunk/libtext-csv-perl/lib/Text/CSV_PP.pm
trunk/libtext-csv-perl/t/71_pp.t
Modified: trunk/libtext-csv-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/Changes?rev=64056&op=diff
==============================================================================
--- trunk/libtext-csv-perl/Changes (original)
+++ trunk/libtext-csv-perl/Changes Wed Oct 20 14:13:08 2010
@@ -1,4 +1,11 @@
Revision history for Perl extension Text::CSV.
+
+1.20 Wed Oct 20 13:53:59 2010
+ - couldn't parse the csv containing the column starting with '0'. (hiratara)
+ * patched by hiratara
+ * enhanced getline regexp (makamaka)
+ * resolved a bug in bleadperl-fb85c04
+ - added tests into t/71_pp.t (hiratara)
1.19 Sat Oct 2 14:15:59 2010
- getline didn't work correctly with 0 or null containing lines
Modified: trunk/libtext-csv-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/META.yml?rev=64056&op=diff
==============================================================================
--- trunk/libtext-csv-perl/META.yml (original)
+++ trunk/libtext-csv-perl/META.yml Wed Oct 20 14:13:08 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Text-CSV
-version: 1.19
+version: 1.20
abstract: comma-separated values manipulator (using XS or PurePerl)
author:
- Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt>
Modified: trunk/libtext-csv-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/README?rev=64056&op=diff
==============================================================================
--- trunk/libtext-csv-perl/README (original)
+++ trunk/libtext-csv-perl/README Wed Oct 20 14:13:08 2010
@@ -1,4 +1,4 @@
-Text::CSV version 1.19
+Text::CSV version 1.20
========================
comma-separated values manipulator
Modified: trunk/libtext-csv-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/debian/changelog?rev=64056&op=diff
==============================================================================
--- trunk/libtext-csv-perl/debian/changelog (original)
+++ trunk/libtext-csv-perl/debian/changelog Wed Oct 20 14:13:08 2010
@@ -1,5 +1,6 @@
-libtext-csv-perl (1.19-2) UNRELEASED; urgency=low
+libtext-csv-perl (1.20-1) UNRELEASED; urgency=low
+ * New upstream release
* Update my email address.
-- Salvatore Bonaccorso <carnil at debian.org> Sun, 10 Oct 2010 15:03:44 +0200
Modified: trunk/libtext-csv-perl/lib/Text/CSV.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/lib/Text/CSV.pm?rev=64056&op=diff
==============================================================================
--- trunk/libtext-csv-perl/lib/Text/CSV.pm (original)
+++ trunk/libtext-csv-perl/lib/Text/CSV.pm Wed Oct 20 14:13:08 2010
@@ -6,7 +6,7 @@
use vars qw( $VERSION $DEBUG );
BEGIN {
- $VERSION = '1.19';
+ $VERSION = '1.20';
$DEBUG = 0;
}
@@ -287,7 +287,7 @@
=head1 VERSION
- 1.19
+ 1.20
This module is compatible with Text::CSV_XS B<0.74> and later.
Modified: trunk/libtext-csv-perl/lib/Text/CSV_PP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/lib/Text/CSV_PP.pm?rev=64056&op=diff
==============================================================================
--- trunk/libtext-csv-perl/lib/Text/CSV_PP.pm (original)
+++ trunk/libtext-csv-perl/lib/Text/CSV_PP.pm Wed Oct 20 14:13:08 2010
@@ -11,7 +11,7 @@
use vars qw($VERSION);
use Carp ();
-$VERSION = '1.27';
+$VERSION = '1.28';
sub PV { 0 }
sub IV { 1 }
@@ -640,7 +640,24 @@
my $is_continued = scalar(my @list = $line =~ /$re/g) % 2; # if line is valid, quot is even
if ( $line =~ /${re}0/ ) { # null suspicion case
- $is_continued = $line =~ /^($re(?:$re$re|${re}0|[^$re])+$re[^0])+$/ ? 0 : 1;
+ $is_continued = $line =~ qr/
+ ^
+ (
+ (?:
+ $re # $quote
+ (?:
+ $re$re # escaped $quote
+ | ${re}0 # or escaped zero
+ | [^$quot] # or exceptions of $quote
+ )*
+ $re # $quote
+ [^0$quot] # non zero or $quote
+ )
+ |
+ (?:[^$quot]*) # exceptions of $quote
+ )+
+ $
+ /x ? 0 : 1;
}
if ( $is_continued and !eof($io) ) {
@@ -979,7 +996,7 @@
=head1 VERSION
- 1.27
+ 1.28
This module is compatible with Text::CSV_XS B<0.74> and later.
Modified: trunk/libtext-csv-perl/t/71_pp.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/t/71_pp.t?rev=64056&op=diff
==============================================================================
--- trunk/libtext-csv-perl/t/71_pp.t (original)
+++ trunk/libtext-csv-perl/t/71_pp.t Wed Oct 20 14:13:08 2010
@@ -5,7 +5,7 @@
use strict;
$^W = 1;
-use Test::More tests => 58;
+use Test::More tests => 88;
BEGIN { $ENV{PERL_TEXT_CSV} = $ARGV[0] || 0; }
@@ -182,6 +182,7 @@
binmode FH;
ok( $csv->print( *FH, [ 0, qq{t"t"\n} ] ) );
+
close( FH );
open( FH, "__test.csv" ) or die $!;
@@ -195,3 +196,109 @@
unlink( '__test.csv' );
}
+
+
+# 2010-10-13 reported by hiratara
+{
+ $csv = Text::CSV->new ({ binary => 1, eol => $/, always_quote => 1 });
+
+ open( FH, '>__test.csv' ) or die $!;
+ binmode FH;
+
+ ok( $csv->print( *FH, [qw/A 01/] ) );
+ ok( $csv->print( *FH, [qw/B 02/] ) );
+ close( FH );
+
+ open( FH, "__test.csv" ) or die $!;
+ binmode FH;
+
+ my $col = $csv->getline( *FH );
+
+ is( $col->[0], 'A' );
+ is( $col->[1], '01' );
+
+ $col = $csv->getline( *FH );
+
+ is( $col->[0], 'B' );
+ is( $col->[1], '02' );
+ close( FH );
+
+ unlink( '__test.csv' );
+}
+
+
+# 2010-10-13 reported(2) by hiratara
+{
+ $csv = Text::CSV->new ({ binary => 1, eol => $/ });
+
+ open( FH, '>__test.csv' ) or die $!;
+ binmode FH;
+
+ ok( $csv->print( *FH, [qw/1 0"/] ) );
+ ok( $csv->print( *FH, [qw/2 0"/] ) );
+ close( FH );
+
+ open( FH, "__test.csv" ) or die $!;
+ binmode FH;
+
+ my $col = $csv->getline( *FH );
+
+ is( $col->[0], '1' );
+ is( $col->[1], '0"' );
+
+ $col = $csv->getline( *FH );
+
+ is( $col->[0], '2' );
+ is( $col->[1], '0"' );
+
+ close( FH );
+
+ unlink( '__test.csv' );
+}
+
+
+{ # previous three test merged
+ $csv = Text::CSV->new ({ binary => 1, eol => $/ });
+
+ open( FH, '>__test.csv' ) or die $!;
+ binmode FH;
+
+ ok( $csv->print( *FH, [ 0, qq{t"t"\n} ] ) );
+ ok( $csv->print( *FH, [qw/A 01/] ) );
+ ok( $csv->print( *FH, [qw/1 0"/] ) );
+ ok( $csv->print( *FH, [undef,undef] ) );
+ ok( $csv->print( *FH, [qw/1 0"/] ) );
+ ok( $csv->print( *FH, [qw/A 01/] ) );
+ close( FH );
+
+ open( FH, "__test.csv" ) or die $!;
+ binmode FH;
+
+ my $col = $csv->getline( *FH );
+ is( $col->[0], "0" );
+ is( $col->[1], qq{t"t"\n} );
+
+ $col = $csv->getline( *FH );
+ is( $col->[0], 'A' );
+ is( $col->[1], '01' );
+
+ $col = $csv->getline( *FH );
+ is( $col->[0], '1' );
+ is( $col->[1], '0"' );
+
+ $col = $csv->getline( *FH );
+ is( $col->[0], '' );
+ is( $col->[1], '' );
+
+ $col = $csv->getline( *FH );
+ is( $col->[0], '1' );
+ is( $col->[1], '0"' );
+
+ $col = $csv->getline( *FH );
+ is( $col->[0], 'A' );
+ is( $col->[1], '01' );
+ close( FH );
+
+ unlink( '__test.csv' );
+}
+
More information about the Pkg-perl-cvs-commits
mailing list