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
|
#!/usr/bin/perl
use strict;
use warnings;
my $tests = 18;
use Test::More;
require Test::NoWarnings;
use Spreadsheet::Read;
Spreadsheet::Read::parses ("gnumeric")
or plan skip_all => "Cannot use Spreadsheet::ReadGnumeric";
BEGIN { delete @ENV{qw( LANG LC_ALL LC_DATE )}; }
my $gnumeric;
ok ($gnumeric = ReadData ("files/Dates.gnumeric"), "Gnumeric date tests");
{ ok (my $ss = $gnumeric->[1], "have sheet");
my @date = (undef, 39668, 39672, 39790, 39673);
foreach my $r (1 .. 4) {
for (1 .. 4) {
is ($ss->{cell}[$_][$r], $date[$r], "Date value row $r col $_");
}
}
}
unless ($ENV{AUTOMATED_TESTING}) {
Test::NoWarnings::had_no_warnings ();
$tests++;
}
done_testing ($tests);
|