Debian Codegraph @

t/style-trailing-space.t

raw
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7
8 plan skip_all => "These tests are for authors only!" unless $ENV{AUTHOR_TESTING} or $ENV{RELEASE_TESTING};
9
10 eval "use Test::TrailingSpace";
11 if ($@)
12 {
13 plan skip_all => "Test::TrailingSpace required for trailing space test.";
14 }
15 else
16 {
17 plan tests => 1;
18 }
19
20 # TODO: add .pod, .PL, the README/Changes/TODO/etc. documents and possibly
21 # some other stuff.
22 my $finder = Test::TrailingSpace->new(
23 {
24 root => '.',
25 filename_regex => qr/(?:\.(?:t|pm|pl|xs|c|h|txt|pod|PL)|README|Changes|TODO|LICENSE)\z/,
26 },
27 );
28
29 # TEST
30 $finder->no_trailing_space(
31 "No trailing space was found."
32 );