File: 06-cell-hyperlink.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 (26 lines) | stat: -rw-r--r-- 790 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
25
26
use strict;
use Test::More tests => 6;
use File::Basename 'dirname';
use Spreadsheet::ParseODS;
use Data::Dumper;

my $d = dirname($0);

my $workbook = Spreadsheet::ParseODS->new()->parse("$d/hyperlink.ods");
my $worksheet = $workbook->worksheet('Sheet1');

is $worksheet->col_max, 0, "We have one used column"
    or diag Dumper $worksheet;

my $cell = $worksheet->get_cell(0,0);
is $cell->value, "A cell";

my $cell = $worksheet->get_cell(1,0);
is $cell->value, "A hyperlink to example.com";
is $cell->get_hyperlink, 'https://example.com/',
    "Retrieving the hyperlink works";

my $cell = $worksheet->get_cell(2,0);
is $cell->value, "A mailto hyperlink";
is $cell->get_hyperlink, 'mailto:corion@example.com?subject=Example mail hyperlink subject',
    "Retrieving the hyperlink works";