File: ProhibitDuplicateSub.run

package info (click to toggle)
libperl-critic-toomuchcode-perl 0.19-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 220 kB
  • sloc: perl: 776; makefile: 2
file content (74 lines) | stat: -rw-r--r-- 1,180 bytes parent folder | download
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
## name simple. case 1.
## failures 1
## cut

sub inc { $_[0] + 1 }
sub dec { $_[0] - 1 }
sub inc { 1 + $_[0] }

## name simple. case 2.
## failures 0
## cut

sub inc { $_[0] + 1 }
sub dec { $_[0] - 1 }

## name Multiple packages in the same Doc without duplicated sub case 1.
## failures 0
## cut

package Here;
sub inc { $_[0] + 1 }

package There;
sub inc { 1 + $_[0] }

## name Multiple packages in the same Doc without duplicated sub. case 2.
## failures 0
## cut

package Here {
    sub inc { $_[0] + 1 }
};
package There {
    sub inc { 1 + $_[0] }
};
## TODO Multiple packages in the same Doc with duplicated sub case 1.
## failures 1
## cut

package Here;
sub inc { $_[0] + 1 }
sub dec { $_[0] - 1 }
sub inc { 1 + $_[0] }

package There;
sub inc { 1 + $_[0] }

## TODO Multiple packages in the same Doc with duplicated sub. case 2.
## failures 1
## cut

package Here {
    sub inc { $_[0] + 1 }
    sub dec { $_[0] - 1 }
    sub inc { 1 + $_[0] }
};
package There {
    sub inc { 1 + $_[0] }
};

## name Multiple BEGIN, UNITCHECK, CHECK, INIT or END blocks
## failures 0
## cut

BEGIN {}
BEGIN {}
UNITCHECK {}
UNITCHECK {}
CHECK {}
CHECK {}
INIT {}
INIT {}
END {}
END {}