Author: jalkanen
Date: Mon Jun 9 13:02:09 2008
New Revision: 665865
URL: http://svn.apache.org/viewvc?rev=665865&view=rev
Log:
Added test for JSPWIKI-228.
Modified:
incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/plugin/TableOfContentsTest.java
Modified:
incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/plugin/TableOfContentsTest.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/plugin/TableOfContentsTest.java?rev=665865&r1=665864&r2=665865&view=diff
==============================================================================
---
incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/plugin/TableOfContentsTest.java
(original)
+++
incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/plugin/TableOfContentsTest.java
Mon Jun 9 13:02:09 2008
@@ -7,6 +7,7 @@
import java.util.Properties;
import com.ecyrd.jspwiki.TestEngine;
+import com.ecyrd.jspwiki.WikiException;
import junit.framework.Test;
import junit.framework.TestCase;
@@ -216,6 +217,21 @@
}
+ public void testSimilarNames() throws WikiException
+ {
+ String src = "[{TableOfContents}]\n\n!Test\n\n!Test\n\n";
+
+ testEngine.saveText( "Test", src );
+
+ String res = testEngine.getHTML( "Test" );
+
+ assertTrue( "Final HTML 1", res.indexOf( "id=\"section-Test-Test\"" )
!= -1 );
+ assertTrue( "Final HTML 2", res.indexOf( "id=\"section-Test-Test-2\""
) != -1 );
+
+ assertTrue( "First test", res.indexOf(
"Wiki.jsp?page=Test#section-Test-Test" ) != -1 );
+ assertTrue( "2nd test", res.indexOf(
"Wiki.jsp?page=Test#section-Test-Test-2" ) != -1 );
+
+ }
public static Test suite()
{
return new TestSuite( TableOfContentsTest.class );