Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2007-01-03 23:49:52 +0000
committerChris Goldthorpe2007-01-03 23:49:52 +0000
commitebf25f1f30a0ebf3ad22c628787810255a2a2d1e (patch)
treef56c6eb4e7f554fffc42796a9161feb78dea9766 /org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests
parent4d94b5dd213cd2cd2598cd43aebbfc42f6887a74 (diff)
downloadeclipse.platform.ua-ebf25f1f30a0ebf3ad22c628787810255a2a2d1e.tar.gz
eclipse.platform.ua-ebf25f1f30a0ebf3ad22c628787810255a2a2d1e.tar.xz
eclipse.platform.ua-ebf25f1f30a0ebf3ad22c628787810255a2a2d1e.zip
Extended markup parser to handle attributes in tags.
Diffstat (limited to 'org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests')
-rw-r--r--org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestMarkupParser.java31
1 files changed, 30 insertions, 1 deletions
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestMarkupParser.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestMarkupParser.java
index c7c639395..822299ac2 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestMarkupParser.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/composite/TestMarkupParser.java
@@ -65,9 +65,38 @@ public class TestMarkupParser extends TestCase {
public void testEscapeAmpersand() {
assertEquals("a&amp;c", parse("<root>a&amp;c</root>"));
}
-
+
public void testNoEscapeQuotes() {
assertEquals("a'b'\"c\"", parse("<root>a'b'\"c\"</root>"));
}
+
+ public void testAttributes() {
+ assertEquals("a<b attr1 = \"true\" attr2 = \"false\">c</b>d<b>e</b>",
+ parse("<root>a<b attr1 = \"true\" attr2=\"false\">c</b>d<b>e</b></root>"));
+ }
+
+ public void testCreateParagraphEmptyString() {
+ assertEquals("<p></p>", MarkupParser.createParagraph("", null));
+ }
+
+ public void testCreateParagraphNoTags() {
+ assertEquals("<p>abc</p>", MarkupParser.createParagraph("abc", null));
+ }
+
+ public void testCreateParagraphTag_p() {
+ assertEquals("<p>abc</p>", MarkupParser.createParagraph("<p>abc</p>", null));
+ }
+
+ public void testCreateParagraphTag_br() {
+ assertEquals("<p><br>abc</p>", MarkupParser.createParagraph("<br>abc", null));
+ }
+
+ public void testCreateParagraphTag_li() {
+ assertEquals("<li>abc</li>", MarkupParser.createParagraph("<li>abc</li>", null));
+ }
+
+ public void testCreateParagraphWithImage_li() {
+ assertEquals("<p><img href=\"def\"/> abc</p>", MarkupParser.createParagraph("abc", "def"));
+ }
}

Back to the top