X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/0929406862437bd518db874e311845dcf14cdc15..72b340de2352eec7d3f99a00e2141a2df35f07f3:/t/helper/csv.t diff --git a/t/helper/csv.t b/t/helper/csv.t index e54dcb6fc..434626f8f 100644 --- a/t/helper/csv.t +++ b/t/helper/csv.t @@ -1,4 +1,4 @@ -use Test::More tests => 36; +use Test::More tests => 39; use SL::Dispatcher; use Data::Dumper; use utf8; @@ -11,7 +11,7 @@ $csv = SL::Helper::Csv->new( header => [ 'description' ], ); -isa_ok $csv->_csv, 'Text::CSV'; +isa_ok $csv->_csv, 'Text::CSV_XS'; isa_ok $csv->_io, 'IO::File'; isa_ok $csv->parse, 'SL::Helper::Csv', 'parsing returns self'; is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'simple case works'; @@ -264,5 +264,33 @@ $csv->parse; is_deeply( ($csv->errors)[0], [ 'description', undef, 'header field \'description\' is not recognized', undef, 0 ], 'strict_profile without ignore_columns throws error'); +##### + +$csv = SL::Helper::Csv->new( + file => \"Kaffee", + header => [ 'description' ], + class => 'SL::DB::Part', +); +$csv->parse; +is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'eol bug at the end of files'; + +##### + +$csv = SL::Helper::Csv->new( + file => \"Description\nKaffee", + class => 'SL::DB::Part', +); +$csv->parse; +is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'case insensitive header from csv works'; + +##### + +$csv = SL::Helper::Csv->new( + file => \"Kaffee", + header => [ 'Description' ], + class => 'SL::DB::Part', +); +$csv->parse; +is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'case insensitive header as param works'; # vim: ft=perl