ヤミRoot VoidGate
User / IP
:
216.73.216.2
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
itrave
/
.cpanm
/
work
/
1568630761.27314
/
DateTime-1.51
/
t
/
Viewing: 24from-object.t
## no critic (Modules::ProhibitMultiplePackages) use strict; use warnings; use Test::More; use DateTime; my $dt1 = DateTime->new( year => 1970, hour => 1, nanosecond => 100 ); my $dt2 = DateTime->from_object( object => $dt1 ); is( $dt1->year, 1970, 'year is 1970' ); is( $dt1->hour, 1, 'hour is 1' ); is( $dt1->nanosecond, 100, 'nanosecond is 100' ); { my $t1 = DateTime::Calendar::_Test::WithoutTZ->new( rd_days => 1, rd_secs => 0 ); # Tests creating objects from other calendars (without time zones) my $t2 = DateTime->from_object( object => $t1 ); isa_ok( $t2, 'DateTime' ); is( $t2->datetime, '0001-01-01T00:00:00', 'convert from object without tz' ); ok( $t2->time_zone->is_floating, 'time_zone is floating' ); } { my $tz = DateTime::TimeZone->new( name => 'America/Chicago' ); my $t1 = DateTime::Calendar::_Test::WithTZ->new( rd_days => 1, rd_secs => 0, time_zone => $tz ); # Tests creating objects from other calendars (with time zones) my $t2 = DateTime->from_object( object => $t1 ); isa_ok( $t2, 'DateTime' ); is( $t2->time_zone->name, 'America/Chicago', 'time_zone is preserved' ); } { my $tz = DateTime::TimeZone->new( name => 'UTC' ); my $t1 = DateTime::Calendar::_Test::WithTZ->new( rd_days => 720258, rd_secs => 86400, time_zone => $tz ); my $t2 = DateTime->from_object( object => $t1 ); isa_ok( $t2, 'DateTime' ); is( $t2->second, 60, 'new DateTime from_object with TZ which is a leap second' ); } { for my $class (qw( DateTime::Infinite::Past DateTime::Infinite::Future )) { isa_ok( DateTime->from_object( object => $class->new ), $class, "from_object($class)" ); } } done_testing(); # Set up two simple test packages package DateTime::Calendar::_Test::WithoutTZ; sub new { my $class = shift; bless {@_}, $class; } sub utc_rd_values { return $_[0]{rd_days}, $_[0]{rd_secs}, 0; } package DateTime::Calendar::_Test::WithTZ; sub new { my $class = shift; bless {@_}, $class; } sub utc_rd_values { return $_[0]{rd_days}, $_[0]{rd_secs}, 0; } sub time_zone { return $_[0]{time_zone}; }
Coded With 💗 by
0x6ick