File: 10_fields.t

package info (click to toggle)
libclass-date-perl 1.1.9-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 172 kB
  • ctags: 104
  • sloc: perl: 665; makefile: 50
file content (26 lines) | stat: -rwxr-xr-x 945 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use Test;
use strict;
BEGIN { plan tests => 18; };
use Class::Date qw(gmdate);

ok(1);

$a = gmdate("2001-07-26 16:15:23");

ok $a->set(year  => 2002), "2002-07-26 16:15:23";
ok $a,"2001-07-26 16:15:23";
ok $a->set(_year =>  105), "2005-07-26 16:15:23";
ok $a,"2001-07-26 16:15:23";
ok $a->set(month =>    4), "2001-04-26 16:15:23";
ok $a->set(mon   =>    9), "2001-09-26 16:15:23";
ok $a->set(_month=>    7), "2001-08-26 16:15:23";
ok $a->set(_mon  =>    2), "2001-03-26 16:15:23";
ok $a->set(day   =>   12), "2001-07-12 16:15:23";
ok $a->set(mday  =>   21), "2001-07-21 16:15:23";
ok $a->set(day_of_month=>5), "2001-07-05 16:15:23";
ok $a->set(hour  =>   14), "2001-07-26 14:15:23";
ok $a->set(min   =>   34), "2001-07-26 16:34:23";
ok $a->set(minute=>   19), "2001-07-26 16:19:23";
ok $a->set(sec   =>   49), "2001-07-26 16:15:49";
ok $a->set(second=>   44), "2001-07-26 16:15:44";
ok $a->set(year => 1985, day => 16), "1985-07-16 16:15:23";