File: bug-3.t

package info (click to toggle)
libspreadsheet-parsexlsx-perl 0.36-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,832 kB
  • sloc: perl: 2,502; makefile: 2
file content (72 lines) | stat: -rw-r--r-- 1,890 bytes parent folder | download | duplicates (4)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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;