Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 7c99fc7

Implemented the %(name)d conversion.

  • Participants
  • Parent commits a12b7af

Comments (0)

Files changed (2)

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

 
     my $format = $self->_fmt;
 
-    $format =~ s/%(%|\(([a-zA-Z_]\w*)\)(s))/
+    $format =~ s/%(%|\(([a-zA-Z_]\w*)\)([ds]))/
         $self->_conversion({
             format_args => $args,
             named_params => $named_params,

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

 use strict;
 use warnings;
 
-use Test::More tests => 7;
+use Test::More tests => 8;
 
 use Text::Sprintf::Named;
 
         "%(name)s conversion"
     );
 }
+
+{
+    # TEST
+    is (n_s("Welcome to %(year)d!", {name => "Tim", year => 20}),
+        "Welcome to 20!",
+        "%(name)d conversion"
+    );
+}
+