File: math_rand.t

package info (click to toggle)
libtemplate-perl 3.102-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,680 kB
  • sloc: perl: 14,945; makefile: 11; sh: 5
file content (19 lines) | stat: -rw-r--r-- 476 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use strict;
use Test::More;
use Template;

plan tests => 1;

my @warnings;
local $SIG{__WARN__} = sub { push @warnings, @_ };
my $t = Template->new;
my $out;
$t->process(\<<EOF, {}, \$out) or die $t->error;
[% USE Math -%]
rand  with arg:    [% Math.rand(1000000) %]
rand  without arg: [% Math.rand %]
srand with arg:    [% Math.srand(1000000) %]
srand without arg: [% Math.srand %]
EOF
#diag $out;
is_deeply \@warnings, [], 'No warnings when calling rand/srand without arg';