Login
ProhibitSingleCharAlternation test was failing when
[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
d095fae4
CD
19## name warnings reported by users (App::Ack)
20## failures 1
8eb8a2e5 21## optional_modules Regexp::Parser
d095fae4
CD
22## cut
23
24return ('shell',TEXT) if $header =~ /\b(?:ba|c|k|z)?sh\b/;
ec024463
CD
25
26## name metacharacters
27## failures 0
28## cut
29
30m/(?: ^ | . | \d | $ )/xms;
31
32## name allowed to have one single character alternation
33## failures 0
34## cut
35
36m/\A (?: a | do | in | queue | rue | woe | xray ) \z/xms;
5ba46c88 37return 1 if $file =~ m/ [.] (?: p (?: l x? | m ) | t | PL ) \z /xms;
ec024463
CD
38
39## name basic failures
40## failures 2
770efb3d 41## optional_modules Regexp::Parser
ec024463
CD
42## cut
43
44m/\A (?: a | d | i | q | r | w | x ) \z/xms;
45m/\A (?: qq| qr | qx | q | s | y | tr ) \z/xms;
46
96c297de
CD
47## name failing regexp with syntax error
48## failures 0
49## cut
50
51m/\A (?: a | d | i | q | r | w | x ) ( \z/xms;
52
ec024463
CD
53#-----------------------------------------------------------------------------
54# Local Variables:
55# mode: cperl
56# cperl-indent-level: 4
57# fill-column: 78
58# indent-tabs-mode: nil
59# c-indentation-style: bsd
60# End:
96fed375 61# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :