Permalink
Browse files

Fix #34

  • Loading branch information...
1 parent 07dda00 commit a9b8fc3050c39a75b402b47ead2bcd6395e57d8b @sirthias committed Oct 5, 2011
Showing with 15 additions and 3 deletions.
  1. +0 −1 src/main/java/org/pegdown/Parser.java
  2. +15 −2 src/test/java/org/pegdown/PathologicalHtmlTest.java
@@ -662,7 +662,6 @@ public Rule EmphOrStrongClose(String chars) {
return Sequence(
TestNot(Spacechar()),
NotNewline(),
- chars.length() == 1 ? TestNot(EmphOrStrong(chars + chars)) : EMPTY,
chars,
TestNot(Alphanumeric())
);
@@ -18,14 +18,14 @@
package org.pegdown;
+import org.testng.Assert;
import org.testng.annotations.Test;
public class PathologicalHtmlTest {
@Test
public void test() {
// this test took about 30 seconds to complete in 0.8.5.4
-
String content = "" +
"<table border>\n" +
"<tr> <th>Your action <th>Partner's action <th>Your jail time <th>Partner's jail time\n" +
@@ -35,6 +35,19 @@ public void test() {
"</table>\n";
long time = System.currentTimeMillis();
new PegDownProcessor(Extensions.SMARTYPANTS | Extensions.AUTOLINKS).markdownToHtml(content);
- System.out.println("elapsed time: " + (System.currentTimeMillis() - time) + " milliseconds");
+ time = System.currentTimeMillis() - time;
+ Assert.assertTrue(time < 1000);
+ }
+
+ @Test
+ public void test2() {
+ // this test took about 30 seconds to complete in 1.0.2
+ String content = "" +
+ "***a*** ***b*** ***c*** ***d*** ***e*** ***f*** ***g*** ***h*** ***i*** ***f*** " +
+ "***g*** ***h*** ***i*** ***j*** ***k*** ***l*** ***m*** ***n*** ***o*** ***p***\n";
+ long time = System.currentTimeMillis();
+ new PegDownProcessor().markdownToHtml(content);
+ time = System.currentTimeMillis() - time;
+ Assert.assertTrue(time < 1000);
}
}

0 comments on commit a9b8fc3

Please sign in to comment.