Revision 7d9888e3
Von Sven Schöling vor mehr als 13 Jahren hinzugefügt
t/helper/csv.t | ||
---|---|---|
1 |
use Test::More tests => 37;
|
|
1 |
use Test::More tests => 39;
|
|
2 | 2 |
use SL::Dispatcher; |
3 | 3 |
use Data::Dumper; |
4 | 4 |
use utf8; |
... | ... | |
274 | 274 |
$csv->parse; |
275 | 275 |
is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'eol bug at the end of files'; |
276 | 276 |
|
277 |
##### |
|
278 |
|
|
279 |
$csv = SL::Helper::Csv->new( |
|
280 |
file => \"Description\nKaffee", |
|
281 |
class => 'SL::DB::Part', |
|
282 |
); |
|
283 |
$csv->parse; |
|
284 |
is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'case insensitive header from csv works'; |
|
285 |
|
|
286 |
##### |
|
287 |
|
|
288 |
$csv = SL::Helper::Csv->new( |
|
289 |
file => \"Kaffee", |
|
290 |
header => [ 'Description' ], |
|
291 |
class => 'SL::DB::Part', |
|
292 |
); |
|
293 |
$csv->parse; |
|
294 |
is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'case insensitive header as param works'; |
|
295 |
|
|
277 | 296 |
# vim: ft=perl |
Auch abrufbar als: Unified diff
Case insensitive header waren nicht voll abgedeckt, und haben Fehler bei kaputten Headern unterdrückt.