while (1) {
my $row = $self->_csv->getline($self->_io);
- last if $self->_csv->eof;
if ($row) {
my %hr;
@hr{@{ $self->header }} = @$row;
push @data, \%hr;
} else {
+ last if $self->_csv->eof;
push @errors, [
$self->_csv->error_input,
$self->_csv->error_diag,
$self->_io->input_line_number,
];
}
+ last if $self->_csv->eof;
}
$self->_data(\@data);
-use Test::More tests => 36;
+use Test::More tests => 37;
use SL::Dispatcher;
use Data::Dumper;
use utf8;
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';
# vim: ft=perl