File: 29_active_sheet.t

package info (click to toggle)
libspreadsheet-parseexcel-perl 0.6500-1.1%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,852 kB
  • sloc: perl: 9,442; makefile: 12
file content (51 lines) | stat: -rwxr-xr-x 1,047 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
#!/usr/bin/perl -w

###############################################################################
#
# A test for Spreadsheet::ParseExcel.
#
# Test for get_active_sheet
#

use strict;

use Test::More tests => 8;

use Spreadsheet::ParseExcel;

##############################################################################
#
# Tests.
#

my $parser = Spreadsheet::ParseExcel->new;

# Workbook saved with sheet2 (index 1) open

my $book = $parser->parse( "t/excel_files/TestActiveSheet.xls" );
my $active = $book->get_active_sheet;
is($active, 1);

my $ws = $book->worksheet('Sheet1');
my $color = $book->color_idx_to_rgb($ws->get_tab_color);
is($color,'339966');

my $hidden = $ws->is_sheet_hidden;
is($hidden, 0);
$hidden = $book->worksheet('Sheet3')->is_sheet_hidden;
is($hidden, 1);

$hidden = $ws->is_row_hidden(1-1);
is($hidden,undef);
$hidden = $ws->is_row_hidden(4-1);
is($hidden,1);

$hidden = $ws->is_col_hidden(ord( 'A' ) - ord( 'A' ));
is($hidden,undef);
$hidden = $ws->is_col_hidden(ord( 'D' ) - ord( 'A' ));
is($hidden,1);




__END__