aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-01-22 20:52:52 +0300
committerGravatar Vitaly Takmazov2019-01-22 20:52:52 +0300
commit0b418caf401c53eb73721a324cd13041c185d0fb (patch)
tree4af4d2b8b7a47db07c98299bbc6dbced3713f125 /src/test/java/com
parentdd7b6d46a7d0efd7198415b6bcc3e86e1d921821 (diff)
Fix quote regex
Diffstat (limited to 'src/test/java/com')
-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>"));
+ }
}