aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/juick')
-rw-r--r--src/test/java/com/juick/MessageTest.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/java/com/juick/MessageTest.java b/src/test/java/com/juick/MessageTest.java
index 2d12a3df..0b48efa1 100644
--- a/src/test/java/com/juick/MessageTest.java
+++ b/src/test/java/com/juick/MessageTest.java
@@ -206,4 +206,13 @@ public class MessageTest {
Remark remark = new Remark(options);
String parsed = remark.convertFragment(text);
}
+ @Test
+ public void messageFormatTest() {
+ String msg = "> quote\nmessage";
+ assertThat(MessageUtils.formatMessage(msg), is("<q>quote</q>message"));
+ String brokenComment = "<!-- read next";
+ assertThat(MessageUtils.formatMessage(brokenComment), is("&lt;!-- read next"));
+ String url = "[ya](http://ya.ru)";
+ assertThat(MessageUtils.formatMessage(url), is("<a href=\"http://ya.ru\" rel=\"nofollow\">ya</a>"));
+ }
}