Revision 1dcc096b
Von Sven Schöling vor mehr als 13 Jahren hinzugefügt
t/helper/csv.t | ||
---|---|---|
125 | 125 |
is $csv->parse, undef, 'broken csv content won\'t get parsed'; |
126 | 126 |
is_deeply $csv->errors, [ '"Kaf"fee";;0.12;1,221.52'."\n", 2023, 'EIQ - QUO character not allowed', 5, 2 ], 'error'; |
127 | 127 |
|
128 |
#### |
|
129 |
|
|
130 |
$csv = SL::Helper::Csv->new( |
|
131 |
file => \<<EOL, |
|
132 |
description;partnumber;sellprice;lastcost_as_number;wiener; |
|
133 |
Kaffee;;0.12;1,221.52;ja wiener |
|
134 |
Beer;1123245;0.12;1.5234;nein kein wieder |
|
135 |
EOL |
|
136 |
numberformat => '1,000.00', |
|
137 |
ignore_unknown_columns => 1, |
|
138 |
class => 'SL::DB::Part', |
|
139 |
); |
|
140 |
$csv->parse; |
|
141 |
is $csv->get_objects->[0]->lastcost, '1221.52', 'ignore_unkown_columns works'; |
|
142 |
|
|
143 |
|
|
128 | 144 |
done_testing(); |
129 | 145 |
# vim: ft=perl |
Auch abrufbar als: Unified diff
SL::Helper::Csv -> ignore_unkown_columns flag