Skip to content

Commit

Permalink
Item12202: add unit tests to check differing timezone offset accross …
Browse files Browse the repository at this point in the history
…DST shift

git-svn-id: http://svn.foswiki.org/trunk@15780 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
FlorianSchlichting authored and FlorianSchlichting committed Oct 29, 2012
1 parent 2857ce7 commit ddd7e79
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions UnitTestContrib/test/unit/TimeTests.pm
Expand Up @@ -205,6 +205,19 @@ sub test_generateIsoOffset {
$tt = Foswiki::Time::parseTime('2009-02-07T00:00Z');
$this->assert_str_equals( '2009-02-07T05:45:00+05:45',
Foswiki::Time::formatTime( $tt, 'iso', 'servertime' ) );

# check DST shift in Europe/Berlin
if ( $^O eq 'MSWin32' ) {
$ENV{TZ} = 'GST-1GDT';
}
else {
$ENV{TZ} = 'Europe/Berlin';
}
POSIX::tzset();
$this->assert_str_equals( '2012-10-30T00:22:48+01:00',
Foswiki::Time::formatTime( 1351552968, 'iso', 'servertime' ) );
$this->assert_str_equals( '2012-10-25T10:17:42+02:00',
Foswiki::Time::formatTime( 1351153062, 'iso', 'servertime' ) );
}

sub test_checkInterval {
Expand Down

0 comments on commit ddd7e79

Please sign in to comment.