From: Bernd Blessmann Date: Wed, 19 Sep 2012 10:37:34 +0000 (+0200) Subject: weitere multiplex-Tests X-Git-Tag: release-3.1.0beta1~22^2~159 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e87f225c21b27c16868cc45b825201d7d86f9c0c;p=kivitendo-erp.git weitere multiplex-Tests --- diff --git a/t/helper/csv.t b/t/helper/csv.t index 82215e63f..092370a72 100644 --- a/t/helper/csv.t +++ b/t/helper/csv.t @@ -1,4 +1,4 @@ -use Test::More tests => 56; +use Test::More tests => 58; use lib 't'; use utf8; @@ -446,8 +446,48 @@ $csv = SL::Helper::Csv->new( $csv->parse; is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'without profile and class works'; +###### + +$csv = SL::Helper::Csv->new( + file => \< [ + {class => 'SL::DB::Part', row_ident => 'P'}, + {class => 'SL::DB::Customer', row_ident => 'C'}, + ], + ignore_unknown_columns => 1, +); +is $csv->parse, undef, 'multiplex: broken csv header won\'t get parsed'; + +###### + +$csv = SL::Helper::Csv->new( + file => \< [ + {class => 'SL::DB::Part', row_ident => 'P'}, + {class => 'SL::DB::Customer', row_ident => 'C'}, + ], + header => [ [], ['name'] ], + ignore_unknown_columns => 1, +); +ok !$csv->_check_multiplexed, 'multiplex check detects empty header'; + + # vim: ft=perl # set emacs to perl mode # Local Variables: # mode: perl # End: +