Show
Ignore:
Timestamp:
11/26/08 14:17:34 (5 years ago)
Author:
daisuke
Message:

apply changes from 0.4501

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/DateTime-Lite/trunk/t/04epoch.t

    r24440 r24912  
    33use strict; 
    44 
    5 use Test::More tests => 28; 
     5use Test::More tests => 32; 
    66 
    77use DateTime::Lite qw(Arithmetic); 
     
    9090    is( $epochtest->epoch, $expected, 
    9191        "epoch method returns correct adjusted value ($expected)"); 
     92 
    9293} 
    9394 
     
    104105    is( $dt->nanosecond, 123_456_789, 'nanosecond should be an integer ' ); 
    105106} 
     107 
     108my $negative_epoch_ok = defined( (localtime(-1))[0] ) ? 1 : 0; 
     109 
     110SKIP: 
     111{ 
     112    skip 'Negative epoch times do not work on some operating systems, including Win32', 4 
     113        unless $negative_epoch_ok; 
     114 
     115    is( DateTime::Lite->new( year => 1904 )->epoch, -2082844800, 
     116        "epoch should work back to at least 1904" ); 
     117 
     118    my $dt = DateTime::Lite->from_epoch( epoch => -2082844800 ); 
     119    is( $dt->year, 1904, 'year should be 1904' ); 
     120    is( $dt->month,   1, 'month should be 1904' ); 
     121    is( $dt->day,     1, 'day should be 1904' ); 
     122} 
     123