1 7 8 package org.netbeans.modules.ruby; 9 10 import junit.framework.TestCase; 11 12 16 public class RDocFormatterTest extends TestCase { 17 18 public RDocFormatterTest(String testName) { 19 super(testName); 20 } 21 22 protected void setUp() throws Exception { 23 super.setUp(); 24 } 25 26 protected void tearDown() throws Exception { 27 super.tearDown(); 28 } 29 30 public void testToHtml() { 31 RDocFormatter instance = new RDocFormatter(); 32 33 instance.appendLine(" # Following does not work:<BR>\n"); 34 instance.appendLine(" # test _italic_<BR>\n"); 35 instance.appendLine(" # test *bold*<BR>\n"); 36 instance.appendLine(" # <P>\n"); 37 instance.appendLine(" # Folowing does:<BR>\n"); 38 instance.appendLine(" # test +typewriter+<BR>\n"); 39 instance.appendLine(" # test <em>italic_html</em><BR>\n"); 40 instance.appendLine(" # test <b>bold_html</b><BR>\n"); 41 instance.appendLine(" # test <tt>typewriter_html</tt><BR>\n"); 42 43 String expected = "<pre>\n" + 44 " # Following does not work:<BR>\n" + 45 "<br> # test <i>italic</i><BR>\n" + 46 "<br> # test <b>bold</b><BR>\n" + 47 "<br> # <P>\n" + 48 "<br> # Folowing does:<BR>\n" + 49 "<br> # test <tt>typewriter</tt><BR>\n" + 50 "<br> # test <em>italic_html</em><BR>\n" + 51 "<br> # test <b>bold_html</b><BR>\n" + 52 "<br> # test <tt>typewriter_html</tt><BR>\n" + 53 "<br></pre>\n"; 54 55 String html = instance.toHtml(); 56 assertEquals(expected, html); 57 } 58 59 } 61 | Popular Tags |