Commits

Shlomi Fish  committed 0789f52

Add t/cpan-changes.t and t/style-trailing-space.t

  • Participants
  • Parent commits c10a42f

Comments (0)

Files changed (9)

File modules/Text-Sprintf-Named/Changes

 Revision history for Text::Sprintf::Named
 
-0.0401  Thu May 24 08:58:19 IDT 2012
+0.0401  2012-05-24
         * Fix the POD to contain an "=encoding utf8" directive (for correctness
         and to appease Pod::Simple 3.21.
             - see http://www.cpantesters.org/cpan/report/6a78d960-a532-11e1-91a2-4d2df4b14d39
 
-0.0400  Sun May  6 23:16:50 IDT 2012
+0.0400  2012-05-06
         * Add a named_sprintf() export for convenient one-off non-OOP
         invocations.
             - Tested in t/04-procedural-iface.t
         * Add keywords and resources to META.json/META.yml.
         * Add the "SIMILAR MODULES" section to the documentation.
 
-0.0301  Thu Sep 10 14:11:07 IDT 2009
+0.0301  2009-09-10
         * Bumped the required version number of Test::Warn to 0.21.
             - Thanks to Eric Wilhelm!
             - http://rt.cpan.org/Public/Bug/Display.html?id=49451
 
-0.0300  Mon Feb 23 13:04:35 IST 2009
+0.0300  2009-02-23
         * Added warnings when used arguments are not specified in the %args.
             - See the t/03-incomplete.t test file.
             - Thanks to kent\n!
 
-0.0203  Sat Jan 10 21:27:31 IST 2009
+0.0203  2009-01-10
         * Corrected two more code typos in the synopsis.
             - Thanks to kent\n!
 
-0.0202  Sat Jan 10 21:22:20 IST 2009
+0.0202  2009-01-10
         * Corrected the synopsis to say ->format({args => \%args})
         instead of ->format(\%args) which was incorrect.
             - Thanks to kent\n!
 
-0.0201  Thu Aug 21 21:25:11 IDT 2008
+0.0201  2008-08-21
         * Changed the Build.PL license from 'bsd' to 'mit'.
         * Added create_makefile_pl => 'passthrough' to Build.PL to
         generate a Makefile.PL in the distribution.
             installed.
         * Revised the licensing information in the POD.
 
-0.02    Fri Apr 20 09:20:15 IDT 2007
+0.02    2007-04-20
         Added the customisation of the named parameter, to determine
         how to calculate it. (see calc_param()).
 
-0.01    TODO : Fill the time.
+0.01    2006-11-22
         First version, released on an unsuspecting world.
 

File modules/Text-Sprintf-Named/MANIFEST

 Build.PL
 Changes
-inc/Test/Run/Builder.pm
-lib/Text/Sprintf/Named.pm
-Makefile.PL
 MANIFEST
 META.json
 META.yml # Will be created by "make dist"
+Makefile.PL
 README
+TODO
+inc/Test/Run/Builder.pm
+lib/Text/Sprintf/Named.pm
 t/00-load.t
 t/01-use.t
 t/02-override-param-retrieval.t
 t/03-incomplete.t
 t/04-procedural-iface.t
 t/boilerplate.t
-TODO
+t/cpan-changes.t
 t/pod-coverage.t
 t/pod.t
+t/style-trailing-space.t

File modules/Text-Sprintf-Named/README

 Text::Sprintf::Named
 
-This module provides a sprintf-like function with named conversions (similar 
+This module provides a sprintf-like function with named conversions (similar
 to the one in Python). So for example the call:
 
-    named_sprintf("Hello %(name)s! Happy new %(year)d!", 
+    named_sprintf("Hello %(name)s! Happy new %(year)d!",
         { name => "Sophie", year => 2007 }
     );
 
 
 Copyright (C) 2006 Shlomi Fish
 
-This program is released under the following license: MIT X11. 
+This program is released under the following license: MIT X11.

File modules/Text-Sprintf-Named/inc/Test/Run/Builder.pm

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

File modules/Text-Sprintf-Named/lib/Text/Sprintf/Named.pm

 Named conversions are sprintf field specifiers (like C<"%s"> or C<"%4d>")
 only they are associated with the key of an associative array of
 parameters. So for example C<"%(name)s"> will emit the C<'name'> parameter
-as a string, and C<"%(num)4d"> will emit the C<'num'> parameter 
+as a string, and C<"%(num)4d"> will emit the C<'num'> parameter
 as a variable with a width of 4.
 
 =head1 FUNCTIONS
         $params = {@args};
     }
 
-    return 
+    return
         Text::Sprintf::Named->new({ fmt => $format})
                             ->format({args => $params});
 }
 
 =head1 ACKNOWLEDGEMENTS
 
-The (possibly ad-hoc) regex for matching the optional digits+symbols 
-parameters' prefix of the sprintf conversion was originally written by Bart 
+The (possibly ad-hoc) regex for matching the optional digits+symbols
+parameters' prefix of the sprintf conversion was originally written by Bart
 Lateur (BARTL on CPAN) for his L<String::Sprintf> module.
 
 The syntax was borrowed directly from Python’s "%" operator when used
 
 =head1 SIMILAR MODULES
 
-L<Text::sprintfn> is a newer module which only provides a procedural interface 
+L<Text::sprintfn> is a newer module which only provides a procedural interface
 that allows one to mix positional and named arguments, with some other
 interesting features.
 

File modules/Text-Sprintf-Named/t/01-use.t

         "Checking ->format() - 2 - empty hashref"
     );
     # TEST
-    is ($obj->format({args => {foo => "Bardom", "isaac" => "Newton"}}), 
+    is ($obj->format({args => {foo => "Bardom", "isaac" => "Newton"}}),
         "95% Humidity",
         "Checking ->format() - 3 - full hashref"
     );
         ;
 }
 
-# TODO: test several different calls to the same format returning 
+# TODO: test several different calls to the same format returning
 # different strings.
 
 {
     is (n_s("I want\n%% Plus\n%% Minus%% Thrice\n%% Dice\n", {}),
         "I want\n% Plus\n% Minus% Thrice\n% Dice\n",
         "Testing multiple consecutive % sign"
-    );   
+    );
 }
 
 {
 
 {
     # TEST
-    is (n_s("You have 0x%(bytes)x bytes left, and your lucky character is %(mychar)c", 
+    is (n_s("You have 0x%(bytes)x bytes left, and your lucky character is %(mychar)c",
             {bytes => 500, mychar => ord('C'),}),
         "You have 0x1f4 bytes left, and your lucky character is C",
         "Testing the %(name)x and %(name)c conversions"
     # TEST
     is ($obj->format({args => {'name' => "Avi", 'num' => "6508" }}),
         "Hello Avi. Your lucky number is 6508!",
-        "Testing multiple ->format calls for the same object - 2"        
+        "Testing multiple ->format calls for the same object - 2"
     );
 }

File modules/Text-Sprintf-Named/t/04-procedural-iface.t

 {
     # TEST
     is (
-        scalar( 
+        scalar(
             named_sprintf(
-                'Hello %(name)s! Are you from %(city)s?', 
+                'Hello %(name)s! Are you from %(city)s?',
                 city => "Lisbon",
                 name => "Sophie",
             )

File modules/Text-Sprintf-Named/t/cpan-changes.t

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+eval 'use Test::CPAN::Changes';
+plan skip_all => 'Test::CPAN::Changes required for this test' if $@;
+
+changes_ok();
+

File modules/Text-Sprintf-Named/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."
+);
+