Shlomi Fish avatar Shlomi Fish committed c06d9a5

Got rid of trailing space.

Comments (0)

Files changed (19)

modules/Test-Count/Changes

 Revision history for Test::Count
 
+    - add t/style-trailing-space.t and got rid of annoying trailing space.
+
 0.0802
     - add "=encoding utf8" to all lib/**.pm files in order to please
     recent versions of Pod::Simple and Test::Pod happy.
     - Add the ./scripts/tag-release.pl to tag a release.
     - Reformat this file (= "Changes") to make it better as far as 4-space
     jumps / indents are concerned.
-           
+
 0.0701      Wed Jun  1 21:38:16 IDT 2011
     - Fix t/04-modify-file-in-place.t to use File::Temp's tempdir().
         - This was done to settle MS-Windows-based testers such as:
 
 0.0103      Tue Nov 20 22:52:42 IST 2007
     - Upgraded Test::Run::Builder that works properly with the recent
-    Test::Run and friends.          
+    Test::Run and friends.
     - Fixed a bug with using variables whose values are zero in
     expressions.
     - Fixed a bug in which assignments were performed twice.

modules/Test-Count/MANIFEST

 t/sample-data/test-scripts/lib/MyMoreTests.pm
 t/sample-data/test-scripts/with-include.t
 t/sample-data/test-scripts/with-indented-plan.t
+t/style-trailing-space.t
 META.json

modules/Test-Count/examples/perl-test-manage-helper.pl

-#!/usr/bin/perl 
+#!/usr/bin/perl
 
 use strict;
 use warnings;
 my $filetype = "perl";
 GetOptions('ft=s' => \$filetype);
 
-my $filter = 
+my $filter =
     Test::Count::Filter->new(
         {
-            ($filetype eq "arc") ? 
+            ($filetype eq "arc") ?
             (
                 assert_prefix_regex => qr{; TEST},
                 plan_prefix_regex => qr{\(plan\s+},

modules/Test-Count/examples/perl-test-manage.vim

 "
 " at the beginning of the test file. Then you need to make sure, every test
 " has a corresponding '# TEST' comment. If you run several tests in a loop,
-" you can append asterisks plus number to the comment. So for example the 
+" you can append asterisks plus number to the comment. So for example the
 " comment:
 "
 "     # TEST*3*5
 " Author: Shlomi Fish
 " Date: 02 December 2004
 " License: MIT X11
-" 
+"
 
 " TODO: Change Get_product to s:get_product().
 

modules/Test-Count/inc/Test/Run/Builder.pm

         Test::Run::CmdLine::Iface->new(
             {
                 'test_files' => [glob("t/*.t")],
-            }   
+            }
             # 'backend_params' => $self->_get_backend_params(),
         );
 
 
 sub ACTION_tags
 {
-    return 
+    return
         system(qw(
             ctags -f tags --recurse --totals
     		--exclude=blib/ --exclude=t/lib

modules/Test-Count/lib/Test/Count.pm

     my $args = shift;
 
     my $in;
-    
+
     if (exists($args->{'filename'}))
     {
         $self->_filename($args->{'filename'});
 =head1 DESCRIPTION
 
 Test::Count is a set of perl modules for keeping track of the number of tests
-in a test file. It works by putting in comments of the form C<# TEST> 
+in a test file. It works by putting in comments of the form C<# TEST>
 (one test), C<# TEST*$EXPR> or C<# TEST+$EXPR> (both are multiple tests).
 Test::Count count these tests throughout the fileand return all of their
 results.
 
 One can put any mathematical expressions (using parentheses, C<+>, C<->,
-C<*>, C</> and C<%> there). 
-One can also assign variables using 
+C<*>, C</> and C<%> there).
+One can also assign variables using
 C<# TEST:$myvar=5+6;$second_var=$myvar+3> and later use them in the add
 to count expressions. A C<$var++> construct is also available.
 
 
 =head2 my $counter = Test::Count->new({'input_fh' => \*MYFILEHANDLE});
 
-Creates a new Test::Count object that process the filehandle specified in 
+Creates a new Test::Count object that process the filehandle specified in
 C<'input_fh'>. Optional keys are:
 
 =over 4
 =head1 GRAMMAR DESCRIPTION
 
 You can put any mathematical expressions (using parentheses, C<+>, C<->,
-C<*>, C</> and C<%> there). 
-You can also assign variables using 
+C<*>, C</> and C<%> there).
+You can also assign variables using
 C<# TEST:$myvar=5+6;$second_var=$myvar+3> and later use them in the add
 to count expressions. A C<$var++> construct is also available.
 
 You can also do C<# TEST:source "path-to-file-here.txt"> where the filename
 comes in quotes, in order to include the filename and process it (similar
-to the C-shell or Bash "source" command) . You can use the special variable 
+to the C-shell or Bash "source" command) . You can use the special variable
 C<$^CURRENT_DIRNAME> there for the dirname of the current file.
 
 Finally, C<# TEST*EXPR()> and C<# TEST+$EXPR()> add tests to the count.
 
     # TEST
     ok (1, "True is true.");
-    
+
     {
         my $val = 'foobar';
 
     use MyFormatProcessor;
 
     # TEST:$num_files=6;
-    my @basenames = 
+    my @basenames =
     (qw(
         basic
         with_ampersands
 
         # TEST*$num_files
         ok (scalar($processor->is_valid()), "'$basename' is valid.");
-    
+
         # TEST*$num_files
-        eq_or_diff ($processor->convert_to_xhtml, 
+        eq_or_diff ($processor->convert_to_xhtml,
             scalar(io("t/data/want-output/$basename.xhtml")->slurp()),
             "Converting '$basename' is successful."
         );

modules/Test-Count/lib/Test/Count/Base.pm

 
     bless $self, $class;
     $self->_init(@_);
-    
+
     return $self;
 }
 

modules/Test-Count/lib/Test/Count/FileMutator.pm

     my $self = shift;
 
     my $ret = $self->_counter()->process();
-    
+
     my $count = $ret->{tests_count};
 
     my $plan_re = $self->_plan_prefix_regex();
     LINES_LOOP:
     while (my $l = shift(@lines))
     {
-        if ($l =~ 
+        if ($l =~
             s{^($plan_re)\d+}{$1$count}
            )
         {
 {
     my ($self, $args) = @_;
 
-    return $self->_parser()->update_count($args->{text});    
+    return $self->_parser()->update_count($args->{text});
 }
 
 =head2 my $count = $parser->get_count()

modules/Test-Count/lib/Test/Count/FileMutator/ByFileType/App.pm

 
     my %params =
     (
-        'lisp' => 
+        'lisp' =>
         {
             assert_prefix_regex => qr{; TEST},
             plan_prefix_regex => qr{\(plan\s+},
     $filetype = exists($aliases{$filetype}) ? $aliases{$filetype} : $filetype;
     my $ft_params = exists($params{$filetype}) ? $params{$filetype} : +{};
 
-    my $mutator = 
+    my $mutator =
         Test::Count::FileMutator->new(
             {
                 filename => $filename,

modules/Test-Count/lib/Test/Count/Filter.pm

     my $self = shift;
 
     my $ret = $self->_counter()->process();
-    
+
     my $count = $ret->{tests_count};
 
     my $plan_re = $self->_plan_prefix_regex();
     LINES_LOOP:
     while (my $l = shift(@lines))
     {
-        if ($l =~ 
+        if ($l =~
             s{^($plan_re)\d+}{$1$count}
            )
         {
 {
     my ($self, $args) = @_;
 
-    return $self->_parser()->update_count($args->{text});    
+    return $self->_parser()->update_count($args->{text});
 }
 
 =head2 my $count = $parser->get_count()

modules/Test-Count/lib/Test/Count/Filter/ByFileType/App.pm

 
 =head1 NAME
 
-Test::Count::Filter::ByFileType::App - a standalone command line application 
+Test::Count::Filter::ByFileType::App - a standalone command line application
 that filters according to the filetype.
 
 =head1 SYNOPSIS
 
     my %params =
     (
-        'lisp' => 
+        'lisp' =>
         {
             assert_prefix_regex => qr{; TEST},
             plan_prefix_regex => qr{\(plan\s+},
     $filetype = exists($aliases{$filetype}) ? $aliases{$filetype} : $filetype;
     my $ft_params = exists($params{$filetype}) ? $params{$filetype} : +{};
 
-    my $filter = 
+    my $filter =
         Test::Count::Filter->new(
             {
                 %{$ft_params},

modules/Test-Count/lib/Test/Count/Parser.pm

 
 =head1 NAME
 
-Test::Count::Parser - A Parser for Test::Count. 
+Test::Count::Parser - A Parser for Test::Count.
 
 =cut
 
 expression:     variable '++'            {$thisparser->{vars}->{$item [1]}++}
               | term '+' expression      {$item [1] + $item [3]}
               | term '-' expression      {$item [1] - $item [3]}
-              | term 
+              | term
 
 term:           factor '*' term          {$item [1] * $item [3]}
               | factor '/' term          {int($item [1] / $item [3])}
 
 factor:         number
               | variable                 {
-                (exists($thisparser->{vars}->{$item [1]}) 
+                (exists($thisparser->{vars}->{$item [1]})
                     ? $thisparser->{vars}->{$item [1]}
                     : do { die "Undefined variable \"$item[1]\""; } )
                     }
 {
     my ($self, $args) = @_;
 
-    return $self->_parser()->update_count($args->{text});    
+    return $self->_parser()->update_count($args->{text});
 }
 
 =head2 my $count = $parser->get_count()

modules/Test-Count/scripts/tag-release.pl

 
 use IO::All;
 
-my ($version) = 
-    (map { m{\$VERSION *= *'([^']+)'} ? ($1) : () } 
+my ($version) =
+    (map { m{\$VERSION *= *'([^']+)'} ? ($1) : () }
     io->file('lib/Test/Count.pm')->getlines()
     )
     ;

modules/Test-Count/t/01-parser.t

             text => q{$myvar=$NUM_ITERS-2}
         },
     );
-    
+
     $parser->update_count(
         {
             text => q{$myvar+$TESTS_PER_ITER}
             text => q{$var1=100}
         },
     );
-    
+
     $parser->update_count(
         {
             text => q{$var1-30}
             text => q{$n*2}
         }
     );
-    
+
     # TEST
-    is ($parser->get_count(), 6, 
+    is ($parser->get_count(), 6,
         "Using a variable whose value is 0 inside an expression"
     );
 }
             text => q{$cnt}
         }
     );
-    
+
     # TEST
-    is ($parser->get_count(), 2, 
+    is ($parser->get_count(), 2,
         "Testing ++",
     );
-    
+
     $parser->update_assignments(
         {
             text => q{$test_num=$cnt}
     );
 
     # TEST
-    is ($parser->get_count(), (2+(2+1)*3), 
+    is ($parser->get_count(), (2+(2+1)*3),
         "Testing assignment to a ++'ed variable",
     );
 }

modules/Test-Count/t/02-main.t

 
 {
     open my $in, "<", File::Spec->catfile("t", "sample-data", "test-scripts", "01-parser.t");
-    
+
     my $counter = Test::Count->new(
         {
             'input_fh' => $in,
 }
 
 {
-    open my $in, "<", 
+    open my $in, "<",
         File::Spec->catfile(
             "t", "sample-data", "test-scripts","arithmetics.t"
         );
-    
+
     my $counter = Test::Count->new(
         {
             'input_fh' => $in,
     my $buffer = "# T" . "EST        \n".
     "ok (1, 'Everything is OK');\n";
     my $in = IO::Scalar->new(\$buffer);
-    
+
     my $counter = Test::Count->new(
         {
             'input_fh' => $in,

modules/Test-Count/t/03-filter.t

     open my $in, "<", File::Spec->catfile("t", "sample-data", "test-scripts", "01-parser.t");
     my $buffer = "";
     my $out = IO::Scalar->new(\$buffer);
-    
+
     my $filter = Test::Count::Filter->new(
         {
             'input_fh' => $in,
             text => q{\$myvar=\$NUM_ITERS-2}
         },
     );
-    
+
     \$parser->update_count(
         {
             text => q{\$myvar+\$TESTS_PER_ITER}
             text => q{\$var1=100}
         },
     );
-    
+
     \$parser->update_count(
         {
             text => q{\$var1-30}
     open my $in, "<", File::Spec->catfile("t", "sample-data", "test-scripts", "basic.arc");
     my $buffer = "";
     my $out = IO::Scalar->new(\$buffer);
-    
+
     my $filter = Test::Count::Filter->new(
         {
             'input_fh' => $in,
     open my $in, "<", File::Spec->catfile("t", "sample-data", "test-scripts", "with-indented-plan.t");
     my $buffer = "";
     my $out = IO::Scalar->new(\$buffer);
-    
+
     my $filter = Test::Count::Filter->new(
         {
             'input_fh' => $in,

modules/Test-Count/t/04-modify-file-in-place.t

     # http://www.nntp.perl.org/group/perl.cpan.testers.discuss/2011/07/msg2523.html
     chmod(0644, $dest);
 
-    return 1; 
+    return 1;
 }
 
 {

modules/Test-Count/t/sample-data/test-scripts/01-parser.t

             text => q{$myvar=$NUM_ITERS-2}
         },
     );
-    
+
     $parser->update_count(
         {
             text => q{$myvar+$TESTS_PER_ITER}
             text => q{$var1=100}
         },
     );
-    
+
     $parser->update_count(
         {
             text => q{$var1-30}

modules/Test-Count/t/style-trailing-space.t

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+eval "use Test::TrailingSpace";
+if ($@)
+{
+    plan skip_all => "Test::TrailingSpace required for trailing space test.";
+}
+else
+{
+    plan tests => 1;
+}
+
+my $finder = Test::TrailingSpace->new(
+    {
+        root => '.',
+        filename_regex => qr/(?:(?:\.(?:t|pm|pl|PL|yml|json|arc|vim))|README|Changes|LICENSE)\z/,
+    },
+);
+
+# TEST
+$finder->no_trailing_space(
+    "No trailing space was found."
+);
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.