Commits

Shlomi Fish committed 032dc95

Add the -n flag.

Comments (0)

Files changed (2)

Module-Format/Module-Format/lib/Module/Format/PerlMF_App.pm

     if (! (my $ret = GetOptionsFromArray(
         $argv,
         '0!' => sub { $delim = "\0"; $suffix = q{}; },
+        'n!' => sub { $delim = "\n"; $suffix = "\n"; },
     )))
     {
         die "GetOptions failed!";

Module-Format/Module-Format/t/perlmf-app.t

     plan skip_all => "Test::Trap not found.";
 }
 
-plan tests => 5;
+plan tests => 6;
 
 # TEST
 ok(1, "Test is OK.");
         'as_rpm_colon -0 works as expected.',
     );
 }
+
+{
+    trap(sub {
+        Module::Format::PerlMF_App->new(
+            {
+                argv => [qw/as_rpm_colon -n Data::Dump XML-Grammar-Fortune/],
+            },
+        )->run();
+    });
+
+    # TEST
+    is (
+        $trap->stdout(), 
+        qq{perl(Data::Dump)\nperl(XML::Grammar::Fortune)\n},
+        '-n works as expected.',
+    );
+}