Hello community, here is the log from the commit of package perl-Text-CSV for openSUSE:Factory checked in at 2018-09-11 17:12:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Text-CSV (Old) and /work/SRC/openSUSE:Factory/.perl-Text-CSV.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Text-CSV" Tue Sep 11 17:12:26 2018 rev:22 rq:631785 version:1.97 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Text-CSV/perl-Text-CSV.changes 2018-08-27 12:56:51.112652411 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Text-CSV.new/perl-Text-CSV.changes 2018-09-11 17:12:26.987858897 +0200 @@ -1,0 +2,10 @@ +Sat Aug 25 06:05:21 UTC 2018 - [email protected] + +- updated to 1.97 + see /usr/share/doc/packages/perl-Text-CSV/Changes + + 1.97 2018-08-17 + - Fix/add minimum perl version (GH-38, Kivanc Yazan++) + - Updated MANIFEST + +------------------------------------------------------------------- Old: ---- Text-CSV-1.96.tar.gz New: ---- Text-CSV-1.97.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Text-CSV.spec ++++++ --- /var/tmp/diff_new_pack.GRQNAz/_old 2018-09-11 17:12:27.523858066 +0200 +++ /var/tmp/diff_new_pack.GRQNAz/_new 2018-09-11 17:12:27.523858066 +0200 @@ -17,7 +17,7 @@ Name: perl-Text-CSV -Version: 1.96 +Version: 1.97 Release: 0 %define cpan_name Text-CSV Summary: Comma-Separated Values Manipulator (Using Xs or Pureperl) ++++++ Text-CSV-1.96.tar.gz -> Text-CSV-1.97.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV-1.96/Changes new/Text-CSV-1.97/Changes --- old/Text-CSV-1.96/Changes 2018-08-14 13:38:11.000000000 +0200 +++ new/Text-CSV-1.97/Changes 2018-08-17 17:22:42.000000000 +0200 @@ -1,5 +1,9 @@ Revision history for Perl extension Text::CSV. +1.97 2018-08-17 + - Fix/add minimum perl version (GH-38, Kivanc Yazan++) + - Updated MANIFEST + 1.96 2018-08-14 - Imported tests/fixes from Text::CSV_XS 1.36 - Added undef_str and keep_headers attributes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV-1.96/MANIFEST new/Text-CSV-1.97/MANIFEST --- old/Text-CSV-1.96/MANIFEST 2018-08-14 13:39:21.000000000 +0200 +++ new/Text-CSV-1.97/MANIFEST 2018-08-17 17:23:46.000000000 +0200 @@ -7,6 +7,7 @@ MANIFEST This list of files README.md t/00_pod.t +t/01_is_pp.t t/10_base.t t/12_acc.t t/15_flags.t @@ -23,6 +24,7 @@ t/55_combi.t t/60_samples.t t/65_allow.t +t/66_formula.t t/70_rt.t t/71_pp.t t/75_hashref.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV-1.96/META.json new/Text-CSV-1.97/META.json --- old/Text-CSV-1.96/META.json 2018-08-14 13:39:20.000000000 +0200 +++ new/Text-CSV-1.97/META.json 2018-08-17 17:23:46.000000000 +0200 @@ -37,7 +37,8 @@ "requires" : { "IO::Handle" : "0", "Test::Harness" : "0", - "Test::More" : "0.71" + "Test::More" : "0.71", + "perl" : "5.006001" } } }, @@ -53,6 +54,6 @@ "url" : "https://github.com/makamaka/Text-CSV" } }, - "version" : "1.96", + "version" : "1.97", "x_serialization_backend" : "JSON::PP version 2.94" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV-1.96/META.yml new/Text-CSV-1.97/META.yml --- old/Text-CSV-1.96/META.yml 2018-08-14 13:39:20.000000000 +0200 +++ new/Text-CSV-1.97/META.yml 2018-08-17 17:23:46.000000000 +0200 @@ -23,9 +23,10 @@ IO::Handle: '0' Test::Harness: '0' Test::More: '0.71' + perl: '5.006001' resources: bugtracker: https://github.com/makamaka/Text-CSV/issues/ license: http://dev.perl.org/licenses/ repository: https://github.com/makamaka/Text-CSV -version: '1.96' +version: '1.97' x_serialization_backend: 'CPAN::Meta::YAML version 0.012' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV-1.96/Makefile.PL new/Text-CSV-1.97/Makefile.PL --- old/Text-CSV-1.96/Makefile.PL 2018-08-14 13:38:11.000000000 +0200 +++ new/Text-CSV-1.97/Makefile.PL 2018-08-17 17:18:09.000000000 +0200 @@ -1,4 +1,4 @@ -use 5.00503; +use 5.006001; use ExtUtils::MakeMaker; use lib qw( ./lib ); @@ -47,6 +47,7 @@ # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'Text::CSV', + 'MIN_PERL_VERSION' => '5.006001', 'VERSION_FROM' => 'lib/Text/CSV.pm', # finds $VERSION 'ABSTRACT_FROM' => 'lib/Text/CSV.pm', # retrieve abstract from module 'AUTHOR' => 'Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt>', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV-1.96/lib/Text/CSV.pm new/Text-CSV-1.97/lib/Text/CSV.pm --- old/Text-CSV-1.96/lib/Text/CSV.pm 2018-08-14 13:38:11.000000000 +0200 +++ new/Text-CSV-1.97/lib/Text/CSV.pm 2018-08-17 17:20:20.000000000 +0200 @@ -9,7 +9,7 @@ @EXPORT_OK = qw( csv ); BEGIN { - $VERSION = '1.96'; + $VERSION = '1.97'; $DEBUG = 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV-1.96/lib/Text/CSV_PP.pm new/Text-CSV-1.97/lib/Text/CSV_PP.pm --- old/Text-CSV-1.96/lib/Text/CSV_PP.pm 2018-08-14 13:38:11.000000000 +0200 +++ new/Text-CSV-1.97/lib/Text/CSV_PP.pm 2018-08-17 17:20:20.000000000 +0200 @@ -5,14 +5,14 @@ # Text::CSV_PP - Text::CSV_XS compatible pure-Perl module # ################################################################################ -require 5.005; +require 5.006001; use strict; use Exporter (); use vars qw($VERSION @ISA @EXPORT_OK); use Carp; -$VERSION = '1.96'; +$VERSION = '1.97'; @ISA = qw(Exporter); @EXPORT_OK = qw(csv); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV-1.96/t/01_is_pp.t new/Text-CSV-1.97/t/01_is_pp.t --- old/Text-CSV-1.96/t/01_is_pp.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Text-CSV-1.97/t/01_is_pp.t 2018-03-17 00:12:58.000000000 +0100 @@ -0,0 +1,18 @@ +#!/usr/bin/perl + +use strict; +$^W = 1; # use warnings core since 5.6 + +use Test::More tests => 4; + +BEGIN { + $ENV{PERL_TEXT_CSV} = 0; + use_ok "Text::CSV"; + plan skip_all => "Cannot load Text::CSV" if $@; + } + +{ + ok my $csv = Text::CSV->new; + ok $csv->is_pp; + is $csv->module => 'Text::CSV_PP'; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV-1.96/t/66_formula.t new/Text-CSV-1.97/t/66_formula.t --- old/Text-CSV-1.96/t/66_formula.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Text-CSV-1.97/t/66_formula.t 2018-08-14 13:38:11.000000000 +0200 @@ -0,0 +1,167 @@ +#!/usr/bin/perl + +use strict; +$^W = 1; + +use Test::More tests => 110; + +BEGIN { + $ENV{PERL_TEXT_CSV} = 0; + use_ok "Text::CSV", (); + plan skip_all => "Cannot load Text::CSV" if $@; + } + +ok (my $csv = Text::CSV->new, "new"); + +is ($csv->formula, "none", "default"); +is ($csv->formula (1), "die", "die"); +is ($csv->formula ("die"), "die", "die"); +is ($csv->formula (2), "croak", "croak"); +is ($csv->formula ("croak"), "croak", "croak"); +is ($csv->formula (3), "diag", "diag"); +is ($csv->formula ("diag"), "diag", "diag"); +is ($csv->formula (4), "empty", "empty"); +is ($csv->formula ("empty"), "empty", "empty"); +is ($csv->formula (""), "empty", "explicit empty"); +is ($csv->formula (5), "undef", "undef"); +is ($csv->formula ("undef"), "undef", "undef"); +is ($csv->formula (undef), "undef", "explicit undef"); +is ($csv->formula (0), "none", "none"); +is ($csv->formula ("none"), "none", "none"); + +is ($csv->formula_handling, "none", "default"); +is ($csv->formula_handling ("DIE"), "die", "die"); +is ($csv->formula_handling ("CROAK"), "croak", "croak"); +is ($csv->formula_handling ("DIAG"), "diag", "diag"); +is ($csv->formula_handling ("EMPTY"), "empty", "empty"); +is ($csv->formula_handling ("UNDEF"), "undef", "undef"); +is ($csv->formula_handling ("NONE"), "none", "none"); + +foreach my $f (-1, 9, "xxx", "DIAX", [], {}, sub {}) { + eval { $csv->formula ($f); }; + like ($@, qr/^formula-handling '\Q$f\E' is not supported/, "$f in invalid"); + } + +my %f = qw( + 0 none none none + 1 die die die + 2 croak croak croak + 3 diag diag diag + 4 empty empty empty + 5 undef undef undef + ); +foreach my $f (sort keys %f) { + ok (my $p = Text::CSV->new ({ formula => $f }), "new with $f"); + is ($p->formula, $f{$f}, "Set to $f{$f}"); + } +eval { Text::CSV->new ({ formula => "xxx" }); }; +like ($@, qr/^formula-handling 'xxx' is not supported/, "xxx in invalid"); + +# Parser + +my @data = split m/\n/ => <<"EOC"; +a,b,c +1,2,3 +=1+2,3,4 +1,=2+3,4 +1,2,=3+4 +EOC + +sub parse { + my $f = shift; + my @d; + ok (my $csv = Text::CSV->new ({ formula => $f }), "new $f"); + for (@data) { + $csv->parse ($_); + push @d, [ $csv->fields ]; + } + \@d; + } # parse + +is_deeply (parse (0), [ + [ "a", "b", "c", ], + [ "1", "2", "3", ], + [ "=1+2", "3", "4", ], + [ "1", "=2+3", "4", ], + [ "1", "2", "=3+4", ], + ], "Default"); + +my $r = eval { parse (1) }; +is ($r, undef, "Die on formulas"); +is ($@, "Formulas are forbidden\n", "Message"); +$@ = undef; + + $r = eval { parse (2) }; +is ($r, undef, "Croak on formulas"); +is ($@, "Formulas are forbidden\n", "Message"); +$@ = undef; + +my @m; +local $SIG{__WARN__} = sub { push @m, @_ }; + +is_deeply (parse (3), [ + [ "a", "b", "c", ], + [ "1", "2", "3", ], + [ "=1+2", "3", "4", ], + [ "1", "=2+3", "4", ], + [ "1", "2", "=3+4", ], + ], "Default"); +is ($@, undef, "Legal with warnings"); +is_deeply (\@m, [ + "Field 1 in record 3 contains formula '=1+2'\n", + "Field 2 in record 4 contains formula '=2+3'\n", + "Field 3 in record 5 contains formula '=3+4'\n", + ], "Warnings"); + +is_deeply (parse (4), [ + [ "a", "b", "c", ], + [ "1", "2", "3", ], + [ "", "3", "4", ], + [ "1", "", "4", ], + [ "1", "2", "", ], + ], "Empty"); + +is_deeply (parse (5), [ + [ "a", "b", "c", ], + [ "1", "2", "3", ], + [ undef, "3", "4", ], + [ "1", undef, "4", ], + [ "1", "2", undef, ], + ], "Undef"); + +{ @m = (); + ok (my $csv = Text::CSV->new ({ formula => 3 }), "new 3 hr"); + ok ($csv->column_names ("code", "value", "desc"), "Set column names"); + ok ($csv->parse ("1,=2+3,4"), "Parse"); + is_deeply (\@m, + [ qq{Field 2 (column: 'value') contains formula '=2+3'\n} ], + "Warning for HR"); + } + +# Writer + +sub writer { + my $f = shift; + ok (my $csv = Text::CSV->new ({ + formula_handling => $f, quote_empty => 1 }), "new $f"); + ok ($csv->combine ("1", "=2+3", "4"), "combine $f"); + $csv->string; + } # writer + +@m = (); +is ( writer (0), q{1,=2+3,4}, "Out 0"); +is (eval { writer (1) }, undef, "Out 1"); +is (eval { writer (2) }, undef, "Out 2"); +is ( writer (3), q{1,=2+3,4}, "Out 3"); +is ( writer (4), q{1,"",4}, "Out 4"); +is ( writer (5), q{1,,4}, "Out 5"); +is_deeply (\@m, [ "Field 1 contains formula '=2+3'\n" ], "Warning 3"); + +@m = (); +is ( writer ("none"), q{1,=2+3,4}, "Out none"); +is (eval { writer ("die") }, undef, "Out die"); +is (eval { writer ("croak") }, undef, "Out croak"); +is ( writer ("diag"), q{1,=2+3,4}, "Out diag"); +is ( writer ("empty"), q{1,"",4}, "Out empty"); +is ( writer ("undef"), q{1,,4}, "Out undef"); +is_deeply (\@m, [ "Field 1 contains formula '=2+3'\n" ], "Warning diag");
