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
|
#!/usr/bin/perl
use strict;
use warnings;
BEGIN { $ENV{SPREADSHEET_READ_ODS} = "Spreadsheet::ParseODS"; }
my $tests = 5;
use Test::More;
require Test::NoWarnings;
use Spreadsheet::Read;
my $pt = Spreadsheet::Read::parses ("ods") or
plan skip_all => "Cannot use $ENV{SPREADSHEET_READ_ODS}";
my $pv = $pt->VERSION;
$pv lt "0.25" and
plan skip_all => "$pt-$pv won't reliably read the test file";
my $ods;
{ local *STDERR; # We want the debug activated, but not shown
open STDERR, ">", "/dev/null" or die "/dev/null: $!\n";
$ods = ReadData ("files/misc.ods",
# All defaults reversed
rc => 0,
cells => 0,
attr => 1,
clip => 1,
debug => 5,
);
}
ok ($ods, "Open with options");
is ($ods->[0]{sheets}, 3, "Sheet Count");
{ local *STDERR; # We want the debug activated, but not shown
open STDERR, ">", "/dev/null" or die "/dev/null: $!\n";
$ods = ReadData ("files/misc.ods",
# All defaults reversed, but undef
rc => undef,
cells => undef,
attr => 1,
clip => 1,
debug => 5,
);
}
ok ($ods, "Open with options");
is ($ods->[1]{cell}[1], undef, "undef works as option value for 'rc'");
ok (!exists $ods->[1]{A1}, "undef works as option value for 'cells'");
#unless ($ENV{AUTOMATED_TESTING}) {
# Test::NoWarnings::had_no_warnings ();
# $tests++;
# }
done_testing ($tests);
|