Revision 417cc3a7
Von Sven Schöling vor mehr als 13 Jahren hinzugefügt
t/helper/csv.t | ||
---|---|---|
140 | 140 |
$csv->parse; |
141 | 141 |
is $csv->get_objects->[0]->lastcost, '1221.52', 'ignore_unkown_columns works'; |
142 | 142 |
|
143 |
##### |
|
144 |
|
|
145 |
$csv = SL::Helper::Csv->new( |
|
146 |
file => \<<EOL, |
|
147 |
description;partnumber;sellprice;lastcost_as_number;buchungsgruppe; |
|
148 |
Kaffee;;0.12;1,221.52;Standard 7% |
|
149 |
Beer;1123245;0.12;1.5234;16 % |
|
150 |
EOL |
|
151 |
numberformat => '1,000.00', |
|
152 |
class => 'SL::DB::Part', |
|
153 |
profile => { |
|
154 |
buchungsgruppe => "buchungsgruppen.description", |
|
155 |
} |
|
156 |
); |
|
157 |
$csv->parse; |
|
158 |
isa_ok $csv->get_objects->[0]->buchungsgruppe, 'SL::DB::Buchungsgruppe', 'deep dispatch auto vivify works'; |
|
159 |
is $csv->get_objects->[0]->buchungsgruppe->description, 'Standard 7%', '...and gets set correctly'; |
|
160 |
|
|
143 | 161 |
|
144 | 162 |
done_testing(); |
145 | 163 |
# vim: ft=perl |
Auch abrufbar als: Unified diff
One-To-One dispatch test.