Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed 3_ole.t for Russian Excel #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions t/2_variant.t
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,10 @@ printf "ok %d\n", ++$Test;
Win32::OLE->Option(LCID => $lcidEnglish);
$v = Variant(VT_DATE, "1 may 1999 17:00");
my $str = $v->Date(DATE_LONGDATE);
print "# LONGDATE is '$str'\n";
print "not " unless $str eq 'Saturday, May 01, 1999';
unless ($str eq 'Saturday, May 01, 1999' || $str eq 'Saturday, May 1, 1999') {
print STDERR "# LONGDATE is '$str'\n";
print "not " ;
}
printf "ok %d\n", ++$Test;

# 28. GetDateFormat with formating string
Expand Down
19 changes: 16 additions & 3 deletions t/3_ole.t
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ open(ME,$0) or die $!;
my $TestCount = grep(/\+\+\$Test/,<ME>);
close(ME);

my $oemcp = GetLocaleInfo(GetSystemDefaultLCID(), LOCALE_IDEFAULTCODEPAGE);

sub stringify {
my $arg = shift;
return "<undef>" unless defined $arg;
Expand Down Expand Up @@ -366,11 +368,23 @@ print "# Value is \"$Value\"\n";
print "not " unless $Value eq 'CamelPerl3.1415';
printf "ok %d\n", ++$Test;

if ($oemcp == 866) {
my ($Version) = $Excel->{Version} =~ /([0-9.]+)/;
print "# Excel version is $Version\n";

my $LCID = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_NEUTRAL));
$LCID = MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL)) if $Version >= 8;
$Excel::LCID = $LCID;
}

# 34. Set a cell formula and retrieve calculated value
$Sheet->Cells(3,1)->{Formula} = '=PI()';
$Value = $Sheet->Cells(3,1)->{Value};
print "# Value is \"$Value\"\n";
print "not " unless abs($Value-3.141592) < 0.00001;
unless (abs($Value-3.141592) < 0.00001) {
print STDERR "#OEM codepage $oemcp\n";
print STDERR "# Value is \"$Value\"\n";
print "not ";
}
printf "ok %d\n", ++$Test;

# 35. Add single worksheet and check that worksheet count is incremented
Expand Down Expand Up @@ -434,7 +448,6 @@ undef @Properties;

# 42. Translate character from ANSI -> OEM
++$Test;
my $oemcp = GetLocaleInfo(GetSystemDefaultLCID(), LOCALE_IDEFAULTCODEPAGE);
if ($oemcp == 437 || $oemcp == 850) {
my ($Version) = $Excel->{Version} =~ /([0-9.]+)/;
print "# Excel version is $Version\n";
Expand Down