summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-12-09 15:05:26 -0500
committerJesse Luehrs <doy@tozt.net>2013-12-09 15:19:32 -0500
commit176c2e79f2704af024e02d755b3dbb714ba72a70 (patch)
tree55484c21c51415c9600820f0c1f057820ffd44fc /t
parentdf3388718f93afb099833d78cdbfdd644ebec594 (diff)
downloadspreadsheet-parsexlsx-176c2e79f2704af024e02d755b3dbb714ba72a70.tar.gz
spreadsheet-parsexlsx-176c2e79f2704af024e02d755b3dbb714ba72a70.zip
support more font properties (#14)
Diffstat (limited to 't')
-rw-r--r--t/bug-14.t35
-rw-r--r--t/data/bug-14.xlsxbin0 -> 5005 bytes
2 files changed, 35 insertions, 0 deletions
diff --git a/t/bug-14.t b/t/bug-14.t
new file mode 100644
index 0000000..3237b0b
--- /dev/null
+++ b/t/bug-14.t
@@ -0,0 +1,35 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+use Spreadsheet::ParseXLSX;
+
+my $wb = Spreadsheet::ParseXLSX->new->parse('t/data/bug-14.xlsx');
+my $ws = $wb->worksheet(0);
+
+for my $row (0..6) {
+ for my $col ($row..6) {
+ next if $row == 5 && $col == 6;
+
+ my $font = $ws->get_cell($row, $col)->get_format->{Font};
+ is($font->{Name}, 'Arial');
+ is(!!$font->{Bold}, $row == 1 || $col == 1);
+ is(!!$font->{Italic}, $row == 2 || $col == 2);
+ is($font->{Height}, 10);
+ is(!!$font->{Underline}, $row == 3 || $col == 3);
+ if ($row == 3 || $col == 3) {
+ is($font->{UnderlineStyle}, 1);
+ }
+ is($font->{Color}, '#000000');
+ is(!!$font->{Strikeout}, $row == 4 || $col == 4);
+ is(
+ $font->{Super},
+ $row == 5 || $col == 5 ? 2
+ : $row == 6 || $col == 6 ? 1
+ : 0
+ );
+ }
+}
+
+done_testing;
diff --git a/t/data/bug-14.xlsx b/t/data/bug-14.xlsx
new file mode 100644
index 0000000..7dfa004
--- /dev/null
+++ b/t/data/bug-14.xlsx
Binary files differ