File: 50_date_epoch.t

package info (click to toggle)
cipux 3.4.0.11-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 316 kB
  • ctags: 59
  • sloc: perl: 1,064; makefile: 13
file content (20 lines) | stat: -rw-r--r-- 543 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use Test::More tests => 4;

BEGIN {
    use_ok('CipUX');
}

use Date::Manip;

my $epoch        = UnixDate( '2010-02-26T10:49:22', '%s' );
my $c            = CipUX->new;
my $cipux_epoch0 = $c->date_epoch;
ok( $cipux_epoch0 eq q{}, 'date_epoch deliver empty string' );

my $cipux_epoch1 = $c->date_epoch({today => 1});
ok( $cipux_epoch1 > 0, 'date_epoch deliver > 0' );

# 1267174162
#diag($cipux_epoch2);
my $cipux_epoch2 = $c->date_epoch( { today => '2010-02-26T10:49:22' } );
ok( $epoch == $cipux_epoch2, 'date_epoch delivers exact epoch' );