Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision be076f02

Von Bernd Bleßmann vor mehr als 3 Jahren hinzugefügt

  • ID be076f02fed09b50c15c8ee8d0585542bd55347d
  • Vorgänger 70e00e04
  • Nachfolger 5fcdbc58

CSV-Helper: Vergessenes Feld "raw_input" bei einigen Fehlermeldungen übergeben …

… Auch, wenn es undefniert ist, aber sonst stimmen die Felder nicht bei
der Fehlerausgabe.

Unterschiede anzeigen:

SL/Helper/Csv.pm
# Each profile needs a class and a row_ident
my $info_ok = all { defined $_->{class} && defined $_->{row_ident} } @profile;
$self->_push_error([
undef,
0,
"missing class or row_ident in one of the profiles for multiplexed data",
0,
......
my @header = @{ $self->header };
my $t_ok = scalar @profile == scalar @header;
$self->_push_error([
undef,
0,
"number of headers and number of profiles must be the same for multiplexed data",
0,
......
$t_ok = all { scalar @$_ > 0} @header;
$self->_push_error([
undef,
0,
"no empty headers are allowed for multiplexed data",
0,
......
$self->_multiplex_datatype_position($first_pos);
return 1;
} else {
$self->_push_error([0,
$self->_push_error([undef,
0,
"datatype field must be at the same position for all datatypes for multiplexed data",
0,
0]);
......
my $header = $self->_header_by_row($row);
if (!$header) {
push @errors, [
undef,
0,
"Cannot get header for row. Maybe row name and datatype field not matching.",
0,
t/helper/csv.t
ignore_unknown_columns => 1,
);
ok !$csv->parse, 'multiplex check detects incosistent datatype field position';
is_deeply( ($csv->errors)[0], [ 0, 'datatype field must be at the same position for all datatypes for multiplexed data', 0, 0 ], 'multiplex data with inconsistent datatype field posiotion throws error');
is_deeply( ($csv->errors)[0], [ undef, 0, 'datatype field must be at the same position for all datatypes for multiplexed data', 0, 0 ], 'multiplex data with inconsistent datatype field posiotion throws error');
#####

Auch abrufbar als: Unified diff