From 4fb85f2dd172445851fee5ea17d450d65f10953f Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 30 Jul 2013 16:17:19 -0400 Subject: test for #3 --- t/bug-3.t | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ t/data/bug-3.xlsx | Bin 0 -> 4539 bytes 2 files changed, 72 insertions(+) create mode 100644 t/bug-3.t create mode 100644 t/data/bug-3.xlsx 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 new file mode 100644 index 0000000..729a630 Binary files /dev/null and b/t/data/bug-3.xlsx differ -- cgit v1.2.3-54-g00ecf