File: 13-merged-areas.t

package info (click to toggle)
libspreadsheet-readsxc-perl 0.39-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,368 kB
  • sloc: perl: 1,377; makefile: 8; xml: 2
file content (24 lines) | stat: -rw-r--r-- 659 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use strict;
use Test::More;
use File::Basename 'dirname';
use Spreadsheet::ParseODS;
use Data::Dumper;

my $d = dirname($0);

plan tests => 2;

my $workbook = Spreadsheet::ParseODS->new()->parse("$d/merged.ods");

my $merged_areas = [$workbook->worksheets()]->[0]->merged_areas();
is_deeply $merged_areas, [
              [0,1,1,2], # B1:C2
              [1,0,2,0], # A2:A3
          ],
          "We read the proper merged areas"
    or diag Dumper $merged_areas;

my $workbook = Spreadsheet::ParseODS->new()->parse("$d/attr.ods");

my $max_col = $workbook->worksheet("Format")->col_max();
is $max_col, 2, "An (empty) merged column at the end still counts";