File: perlish_for_percentage.t

package info (click to toggle)
libsmart-comments-perl 1.000005-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 200 kB
  • ctags: 12
  • sloc: perl: 302; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 712 bytes parent folder | download | duplicates (5)
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
use Smart::Comments;
use Test::More 'no_plan';

close *STDERR;
my $STDERR = q{};
open *STDERR, '>', \$STDERR;

my $count = 0;

LABEL:

for (1..5) {    ### Simple for loop:===[%]   done (%)
    # nothing
}

like $STDERR, qr/Simple for loop:\[0%\]      done \(0%\)/
                                            => 'First iteration';

like $STDERR, qr/Simple for loop:\[25%\]    done \(25%\)/ 
                                            => 'Second iteration';

like $STDERR, qr/Simple for loop:\[50%\]    done \(50%\)/ 
                                            => 'Third iteration';
  
like $STDERR, qr/Simple for loop:=\[75%\]   done \(75%\)/ 
                                            => 'Fourth iteration';