File: 20_now.t

package info (click to toggle)
libticket-simple-perl 0.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 172 kB
  • ctags: 14
  • sloc: perl: 397; makefile: 7
file content (19 lines) | stat: -rw-r--r-- 386 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
#!perl -w

use warnings;
use strict;
use Test::More tests => 4;
use Time::HiRes qw(gettimeofday);

BEGIN {
    use_ok('Ticket::Simple');
}

my ( $s1, $ms1 ) = gettimeofday;
my $ts = Ticket::Simple->new();
my $n  = $ts->now();
my ( $s2, $ms2 ) = gettimeofday;
ok( $n,              '- now returns true' );
ok( $n > "$s1.$ms1", '- now > before' );
ok( $n < "$s2.$ms2", '- now < after' );