Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 81d60dc

Now accepting empty parameters.

  • Participants
  • Parent commits 0ca24b1

Comments (0)

Files changed (3)

File modules/App-XML-DocBook-Docmake/Changes

+        - now accepting --stringparam "empty.param=" notation for empty
+        string parameters.
+
 0.01    Fri Jul 11 13:58:14 IDT 2008
         - First version.
         - Has "fo", "xhtml", "pdf" and "rtf" modes.

File modules/App-XML-DocBook-Docmake/lib/App/XML/DocBook/Docmake.pm

     my @stringparams;
     foreach my $param (@in_stringparams)
     {
-        if ($param =~ m{\A([^=]+)=(.+)\z}ms)
+        if ($param =~ m{\A([^=]+)=(.*)\z}ms)
         {
             push @stringparams, [$1,$2];
         }

File modules/App-XML-DocBook-Docmake/t/01-use.t

 use strict;
 use warnings;
 
-use Test::More tests => 12;
+use Test::More tests => 14;
 use Test::Trap qw( trap $trap :flow:stderr(systemsafe):stdout(systemsafe):warn );
 
 use App::XML::DocBook::Docmake;
         "testing that .fo is added if the pdf filename does not contain a prefix",
     );
 }
+
+{
+    my $docmake = MyTest::DocmakeAppDebug->new({argv => [
+            "-v",
+            "--stringparam",
+            "empty.param=",
+            "-o", "my-output-dir",
+            "xhtml",
+            "input.xml",
+            ]});
+
+    # TEST
+    ok ($docmake, "Docmake was constructed successfully");
+
+    $docmake->run();
+
+    # TEST
+    is_deeply(MyTest::DocmakeAppDebug->debug_commands(),
+        [
+            [
+                "xsltproc",
+                "-o", "my-output-dir/",
+                "--stringparam", "empty.param", "",
+                "http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl",
+                "input.xml",
+            ]
+        ],
+        "an empty stringparam is accepted and propagated to the xsltproc command",
+    );
+}