Lines 75-90
isa_ok( $new_dt, 'DateTime', 'Create DateTime with different timezone' );
Link Here
|
75 |
cmp_ok( $new_dt->ymd(), 'eq', $testdate_iso, |
75 |
cmp_ok( $new_dt->ymd(), 'eq', $testdate_iso, |
76 |
'Returned Dublin object matches input' ); |
76 |
'Returned Dublin object matches input' ); |
77 |
|
77 |
|
78 |
for ( qw/ 2014-01-01 2100-01-01 9999-01-01 / ) { |
78 |
SKIP: { |
79 |
my $duration = gettimeofday(); |
79 |
skip "Don't test execution time of dt_from_string on slow servers", 6 if $ENV{SLOW_SERVER}; |
80 |
$new_dt = dt_from_string($_, 'iso', $dear_dirty_dublin); |
80 |
for ( qw/ 2014-01-01 2100-01-01 9999-01-01 / ) { |
81 |
$duration = gettimeofday() - $duration; |
81 |
my $duration = gettimeofday(); |
82 |
cmp_ok $duration, '<', 2, "Create DateTime with dt_from_string() for $_ with TZ in less than 2s"; |
82 |
$new_dt = dt_from_string($_, 'iso', $dear_dirty_dublin); |
83 |
$duration = gettimeofday(); |
83 |
$duration = gettimeofday() - $duration; |
84 |
output_pref( { dt => $new_dt } ); |
84 |
cmp_ok $duration, '<', 1, "Create DateTime with dt_from_string() for $_ with TZ in less than 1s"; |
85 |
$duration = gettimeofday() - $duration; |
85 |
$duration = gettimeofday(); |
86 |
cmp_ok $duration, '<', 2, "Create DateTime with output_pref() for $_ with TZ in less than 2s"; |
86 |
output_pref( { dt => $new_dt } ); |
87 |
} |
87 |
$duration = gettimeofday() - $duration; |
|
|
88 |
cmp_ok $duration, '<', 1, "Create DateTime with output_pref() for $_ with TZ in less than 1s"; |
89 |
} |
90 |
}; |
88 |
|
91 |
|
89 |
$new_dt = dt_from_string( '2011-06-16 12:00', 'sql' ); |
92 |
$new_dt = dt_from_string( '2011-06-16 12:00', 'sql' ); |
90 |
isa_ok( $new_dt, 'DateTime', 'Create DateTime from (mysql) sql' ); |
93 |
isa_ok( $new_dt, 'DateTime', 'Create DateTime from (mysql) sql' ); |
91 |
- |
|
|