diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-07-30 16:17:19 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-07-30 16:17:19 -0400 |
commit | 4fb85f2dd172445851fee5ea17d450d65f10953f (patch) | |
tree | d6022fe6888e91be4990515f3ab86122f539ee00 /t | |
parent | 722082d52bb34d7e32613b879d5a3e4900549dba (diff) | |
download | spreadsheet-parsexlsx-4fb85f2dd172445851fee5ea17d450d65f10953f.tar.gz spreadsheet-parsexlsx-4fb85f2dd172445851fee5ea17d450d65f10953f.zip |
test for #3
Diffstat (limited to 't')
-rw-r--r-- | t/bug-3.t | 72 | ||||
-rw-r--r-- | t/data/bug-3.xlsx | bin | 0 -> 4539 bytes |
2 files changed, 72 insertions, 0 deletions
diff --git a/t/bug-3.t b/t/bug-3.t new file mode 100644 index 0000000..27cfd03 --- /dev/null +++ b/t/bug-3.t @@ -0,0 +1,72 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +use Spreadsheet::ParseXLSX; + +my $wb = Spreadsheet::ParseXLSX->new->parse('t/data/bug-3.xlsx'); +is($wb->worksheet_count, 1); + +my $ws = $wb->worksheet(0); +is($ws->get_name, 'Sheet1'); + +is_deeply([$ws->row_range], [0, 1]); +is_deeply([$ws->col_range], [0, 2]); +is_deeply($ws->{Selection}, [1, 2]); + +{ + my $cell = $ws->get_cell(0, 0); + is($cell->value, "red"); + is($cell->type, 'Text'); + is($cell->get_format->{Font}{Color}, '#000000'); + is($cell->get_format->{Font}{Name}, 'Arial'); + is($cell->get_format->{Font}{Height}, '10'); +} + +{ + my $cell = $ws->get_cell(0, 1); + is($cell->value, "blue"); + is($cell->type, 'Text'); + is($cell->get_format->{Font}{Color}, '#000000'); + is($cell->get_format->{Font}{Name}, 'Arial'); + is($cell->get_format->{Font}{Height}, '10'); +} + +{ + my $cell = $ws->get_cell(0, 2); + is($cell->value, "green"); + is($cell->type, 'Text'); + is($cell->get_format->{Font}{Color}, '#000000'); + is($cell->get_format->{Font}{Name}, 'Arial'); + is($cell->get_format->{Font}{Height}, '10'); +} + +{ + my $cell = $ws->get_cell(1, 0); + is($cell->value, "233"); + is($cell->type, 'Numeric'); + is($cell->get_format->{Font}{Color}, '#000000'); + is($cell->get_format->{Font}{Name}, 'Arial'); + is($cell->get_format->{Font}{Height}, '10'); +} + +{ + my $cell = $ws->get_cell(1, 1); + is($cell->value, "444"); + is($cell->type, 'Numeric'); + is($cell->get_format->{Font}{Color}, '#000000'); + is($cell->get_format->{Font}{Name}, 'Arial'); + is($cell->get_format->{Font}{Height}, '10'); +} + +{ + my $cell = $ws->get_cell(1, 2); + is($cell->value, "566"); + is($cell->type, 'Numeric'); + is($cell->get_format->{Font}{Color}, '#000000'); + is($cell->get_format->{Font}{Name}, 'Arial'); + is($cell->get_format->{Font}{Height}, '10'); +} + +done_testing; diff --git a/t/data/bug-3.xlsx b/t/data/bug-3.xlsx Binary files differnew file mode 100644 index 0000000..729a630 --- /dev/null +++ b/t/data/bug-3.xlsx |