line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Simply; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
712
|
use 5.00503; |
|
1
|
|
|
|
|
3
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
32
|
|
5
|
1
|
|
|
1
|
|
5
|
use vars qw($VERSION $tests $testno $ok); |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
119
|
|
6
|
|
|
|
|
|
|
$VERSION = 0.05; |
7
|
|
|
|
|
|
|
$tests = 0; |
8
|
|
|
|
|
|
|
$testno = 1; |
9
|
|
|
|
|
|
|
$ok = 0; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
BEGIN { |
12
|
1
|
|
|
1
|
|
183
|
$| = 1; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
INIT { |
16
|
|
|
|
|
|
|
$SIG{__DIE__} = sub { exit(255) }; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
END { |
20
|
1
|
50
|
|
1
|
|
0
|
exit((($tests-$ok)<=254) ? ($tests-$ok) : 254); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub import { |
24
|
1
|
50
|
|
1
|
|
10
|
if ($_[1] eq 'tests') { |
25
|
1
|
|
|
|
|
1
|
$tests = $_[2]; |
26
|
1
|
|
|
|
|
33
|
print "1..$tests\n"; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
else { |
29
|
0
|
|
|
|
|
0
|
die "Test::Simply requires 'tests', like 'use Test::Simply tests => 3;'\n"; |
30
|
|
|
|
|
|
|
} |
31
|
1
|
|
|
1
|
|
6
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
213
|
|
32
|
1
|
|
|
|
|
2
|
*{caller() . '::ok'} = \&ok; |
|
1
|
|
|
|
|
40
|
|
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub ok { |
36
|
0
|
0
|
|
0
|
0
|
|
if ($_[0]) { |
37
|
0
|
|
|
|
|
|
print join(' - ',grep(/./,"ok $testno",$_[1])), "\n"; |
38
|
0
|
|
|
|
|
|
$ok++; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
else { |
41
|
0
|
|
|
|
|
|
print join(' - ',grep(/./,"not ok $testno",$_[1])), "\n"; |
42
|
|
|
|
|
|
|
} |
43
|
0
|
|
|
|
|
|
$testno++; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |