Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 163ee7c

.fo is added if the pdf filename does not contain a prefix.

  • Participants
  • Parent commits a61e387

Comments (0)

Files changed (2)

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

     my $xslt_output_path = $self->_output_path();
 
     # TODO : do something meaningful if a period (".") is not present
-    $xslt_output_path =~ s{\.([^\.]*)\z}{\.fo}ms;
+    if ($xslt_output_path !~ m{\.}ms)
+    {
+        $xslt_output_path .= ".fo";
+    }
+    else
+    {
+        $xslt_output_path =~ s{\.([^\.]*)\z}{\.fo}ms;
+    }
 
     $self->_run_xslt({output_path => $xslt_output_path});
 

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

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