r283 - in jrst/trunk/src: main/java/org/codelutin/jrst test/java/org/codelutin/jrst
Author: chatellier Date: 2009-02-27 08:52:39 +0000 (Fri, 27 Feb 2009) New Revision: 283 Modified: jrst/trunk/src/main/java/org/codelutin/jrst/JRSTLexer.java jrst/trunk/src/test/java/org/codelutin/jrst/JRSTGeneratorTest.java Log: Parse comment after footnote directive. Fix test. Modified: jrst/trunk/src/main/java/org/codelutin/jrst/JRSTLexer.java =================================================================== --- jrst/trunk/src/main/java/org/codelutin/jrst/JRSTLexer.java 2009-02-27 08:17:59 UTC (rev 282) +++ jrst/trunk/src/main/java/org/codelutin/jrst/JRSTLexer.java 2009-02-27 08:52:39 UTC (rev 283) @@ -480,11 +480,7 @@ if (result == null) { result = peekDirectiveOrReference(); } - // comment must be read after peekDirectiveOrReference() if (result == null) { - result = peekComment(); - } - if (result == null) { result = peekTransition(); } if (result == null) { @@ -508,7 +504,12 @@ if (result == null) { result = peekFootnote(); } + // comment must be read after peekDirectiveOrReference() + // and peekFootnote() if (result == null) { + result = peekComment(); + } + if (result == null) { result = peekDefinitionList(); } if (result == null) { Modified: jrst/trunk/src/test/java/org/codelutin/jrst/JRSTGeneratorTest.java =================================================================== --- jrst/trunk/src/test/java/org/codelutin/jrst/JRSTGeneratorTest.java 2009-02-27 08:17:59 UTC (rev 282) +++ jrst/trunk/src/test/java/org/codelutin/jrst/JRSTGeneratorTest.java 2009-02-27 08:52:39 UTC (rev 283) @@ -19,6 +19,8 @@ import java.io.File; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.junit.Ignore; import org.junit.Test; @@ -35,16 +37,28 @@ */ public class JRSTGeneratorTest { + /** to use log facility, just put in your code: log.info("..."); */ + protected static Log log = LogFactory.getLog(JRSTGeneratorTest.class); + @Test - public void testRstToHtml() throws Exception { + public void testRstToRst() throws Exception { - File test1 = File.createTempFile("jrst-RstToHtml", ".html"); + if (log.isInfoEnabled()) { + log.info("Testing RST to RST (test.rst)..."); + } + + File test1 = File.createTempFile("jrst-RstToRst", ".rst"); JRST.main(new String[] { "-t", "rst", "--force", "-o", test1.getAbsolutePath(), "src/test/resources/test.rst", }); test1.delete(); } @Test - public void testRstToHtml2() throws Exception { + public void testRstToHtml() throws Exception { + + if (log.isInfoEnabled()) { + log.info("Testing RST to HTML (test.rst)..."); + } + File test1 = File.createTempFile("jrst-RstToHtml2", ".html"); JRST.main(new String[] { "-t", "html", "--force", "-o", test1.getAbsolutePath(), "src/test/resources/text.rst" }); test1.delete(); @@ -53,6 +67,10 @@ @Test public void testRstToDocbook() throws Exception { + if (log.isInfoEnabled()) { + log.info("Testing RST to Docbook (test.rst)..."); + } + File test1 = File.createTempFile("jrst-RstToDocbook", ".dbk"); JRST.main(new String[]{"-t", "docbook", "--force","-o", test1.getAbsolutePath(), "src/test/resources/test.rst"}); @@ -61,10 +79,15 @@ @Test public void testRstToXdoc() throws Exception { + + if (log.isInfoEnabled()) { + log.info("Testing RST to Xdoc (test.rst)..."); + } + File test1 = File.createTempFile("jrst-RstToXdoc", ".xdoc"); JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(), "src/test/resources/test.rst" }); - //test1.delete(); + test1.delete(); } /** @@ -74,6 +97,11 @@ */ @Ignore public void testRstToXdoc2() throws Exception { + + if (log.isInfoEnabled()) { + log.info("Testing RST to Xdoc (test2.rst)..."); + } + File test1 = File.createTempFile("jrst-RstToXdoc2", ".xdoc"); JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(), "src/test/resources/test2.rst" }); @@ -82,6 +110,11 @@ @Test public void testRstToXdoc3() throws Exception { + + if (log.isInfoEnabled()) { + log.info("Testing RST to Xdoc (test3.rst) ..."); + } + File test1 = File.createTempFile("jrst-RstToXdoc3", ".xdoc"); JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(), "src/test/resources/test3.rst" }); @@ -90,6 +123,11 @@ @Test public void testRstToXdoc4() throws Exception { + + if (log.isInfoEnabled()) { + log.info("Testing RST to Xdoc (test4.rst) ..."); + } + File test1 = File.createTempFile("jrst-RstToXdoc4", ".xdoc"); JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(), "src/test/resources/test4.rst" }); @@ -98,9 +136,27 @@ @Test public void testRstToXdocJrstSite() throws Exception { + + if (log.isInfoEnabled()) { + log.info("Testing RST to Xdoc (frEntier.rst) ..."); + } + File test1 = File.createTempFile("jrst-RstToXdocJrstSite", ".xdoc"); JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(), "src/test/resources/frEntier.rst" }); test1.delete(); } + + @Ignore + public void testRstToPDF() throws Exception { + + if (log.isInfoEnabled()) { + log.info("Testing RST to PDF (frEntier.rst) ..."); + } + + File test1 = File.createTempFile("jrst-RstToPDF", ".pdf"); + JRST.main(new String[] { "-t", "pdf", "--force","-o", test1.getAbsolutePath(), + "src/test/resources/frEntier.rst" }); + test1.delete(); + } }
participants (1)
-
chatellierï¼ users.labs.libre-entreprise.org