File: prototypes.t

package info (click to toggle)
libtest-mocktime-perl 0.17-0%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 100 kB
  • sloc: perl: 239; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 500 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#! /usr/bin/perl 
use Test::MockTime ':all';
use Test::More tests => 3;
use strict;
use warnings;

set_fixed_time(2);
my $four = time + 2;
is($four, 4, "time() does not try so slurp any arguments");

my @arr    = (0, 1, 2);
my $got    = localtime @arr;
my $expect = localtime scalar @arr;
is($got, $expect, "localtime() treats its argument as an expression");

$got    = gmtime @arr;
$expect = gmtime scalar @arr;
is($got, $expect, "gmtime() treats its argument as an expression");