Login
New policy RegularExpressions::ProhibitSingleCharAlternation
[gknop/Perl-Critic.git] / t / RegularExpressions / ProhibitSingleCharAlternation.run
CommitLineData
ec024463
CD
1##############################################################################
2# $URL$
3# $Date$
4# $Author$
5# $Revision$
6##############################################################################
7
8## name basic passes
9## failures 0
10## cut
11
12m/\A [adiqrwx] \z/xms;
13m/\A (?: qq | qr | qx | [qsy] | tr ) \z/xms;
14m/\A (?: q[qrx] | [qsy] | tr ) \z/xms;
15
16m/\A (?: a ) \z/xms; # bad form, but not a violation of this policy
17m/\A (?: [a] ) \z/xms; # bad form, but not a violation of this policy
18
19
20## name metacharacters
21## failures 0
22## cut
23
24m/(?: ^ | . | \d | $ )/xms;
25
26## name allowed to have one single character alternation
27## failures 0
28## cut
29
30m/\A (?: a | do | in | queue | rue | woe | xray ) \z/xms;
31
32## name basic failures
33## failures 2
34## cut
35
36m/\A (?: a | d | i | q | r | w | x ) \z/xms;
37m/\A (?: qq| qr | qx | q | s | y | tr ) \z/xms;
38
39#-----------------------------------------------------------------------------
40# Local Variables:
41# mode: cperl
42# cperl-indent-level: 4
43# fill-column: 78
44# indent-tabs-mode: nil
45# c-indentation-style: bsd
46# End:
47# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab :