src_trailingspace.t (416B)
1 # 2 # Test that source files have no trailing whitespace. 3 # 4 use Modern::Perl; 5 use Test::More; 6 7 8 # Test is optional. 9 eval "use Test::TrailingSpace"; 10 if ($@) { 11 plan skip_all => "Test::TrailingSpace not found."; 12 } else { 13 plan tests => 1; 14 } 15 16 my $finder = Test::TrailingSpace->new( 17 { 18 root => '.', 19 filename_regex => qr/\.(?:t|pm|pl|cc|c|h|sh|1)\z/, 20 }, 21 ); 22 23 $finder->no_trailing_space("no trailing spaces in source");