Revision be076f02
Von Bernd Bleßmann vor mehr als 3 Jahren hinzugefügt
SL/Helper/Csv.pm | ||
---|---|---|
114 | 114 |
# Each profile needs a class and a row_ident |
115 | 115 |
my $info_ok = all { defined $_->{class} && defined $_->{row_ident} } @profile; |
116 | 116 |
$self->_push_error([ |
117 |
undef, |
|
117 | 118 |
0, |
118 | 119 |
"missing class or row_ident in one of the profiles for multiplexed data", |
119 | 120 |
0, |
... | ... | |
125 | 126 |
my @header = @{ $self->header }; |
126 | 127 |
my $t_ok = scalar @profile == scalar @header; |
127 | 128 |
$self->_push_error([ |
129 |
undef, |
|
128 | 130 |
0, |
129 | 131 |
"number of headers and number of profiles must be the same for multiplexed data", |
130 | 132 |
0, |
... | ... | |
133 | 135 |
|
134 | 136 |
$t_ok = all { scalar @$_ > 0} @header; |
135 | 137 |
$self->_push_error([ |
138 |
undef, |
|
136 | 139 |
0, |
137 | 140 |
"no empty headers are allowed for multiplexed data", |
138 | 141 |
0, |
... | ... | |
231 | 234 |
$self->_multiplex_datatype_position($first_pos); |
232 | 235 |
return 1; |
233 | 236 |
} else { |
234 |
$self->_push_error([0, |
|
237 |
$self->_push_error([undef, |
|
238 |
0, |
|
235 | 239 |
"datatype field must be at the same position for all datatypes for multiplexed data", |
236 | 240 |
0, |
237 | 241 |
0]); |
... | ... | |
254 | 258 |
my $header = $self->_header_by_row($row); |
255 | 259 |
if (!$header) { |
256 | 260 |
push @errors, [ |
261 |
undef, |
|
257 | 262 |
0, |
258 | 263 |
"Cannot get header for row. Maybe row name and datatype field not matching.", |
259 | 264 |
0, |
t/helper/csv.t | ||
---|---|---|
629 | 629 |
ignore_unknown_columns => 1, |
630 | 630 |
); |
631 | 631 |
ok !$csv->parse, 'multiplex check detects incosistent datatype field position'; |
632 |
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'); |
|
632 |
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');
|
|
633 | 633 |
|
634 | 634 |
##### |
635 | 635 |
|
Auch abrufbar als: Unified diff
CSV-Helper: Vergessenes Feld "raw_input" bei einigen Fehlermeldungen übergeben …
… Auch, wenn es undefniert ist, aber sonst stimmen die Felder nicht bei
der Fehlerausgabe.