File: 16-reap-numerous.t

package info (click to toggle)
libscope-upper-perl 0.18-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 460 kB
  • sloc: perl: 5,592; makefile: 7
file content (29 lines) | stat: -rw-r--r-- 327 bytes parent folder | download | duplicates (6)
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
27
28
29
#!perl -T

use strict;
use warnings;

my $n;
BEGIN { $n = 1000; }

use Test::More tests => $n;

use Scope::Upper qw<reap UP>;

my $count;

sub setup {
 for my $i (reverse 1 .. $n) {
  reap {
   is $count, $i, "$i-th destructor called at the right time";
   ++$count;
  } UP UP;
 }
}

$count = $n + 1;

{
 setup;
 $count = 1;
}