From e4defa51ce6f124a76fc369c862c64553f7a0114 Mon Sep 17 00:00:00 2001 From: k0st1x Date: Fri, 20 Apr 2018 15:42:49 +0300 Subject: fixes issue — do not collect tags from commented/quoted lines --- .../src/test/java/com/juick/server/tests/ServerTests.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'juick-server/src/test/java/com/juick') diff --git a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java index e23116ad..e8111239 100644 --- a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java +++ b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java @@ -754,6 +754,19 @@ public class ServerTests { commandsManager.processCommand(user, "D #" + mid, emptyUri).getText()); assertEquals("should be not found", "Message not found", commandsManager.processCommand(user, "#" + mid, emptyUri).getText()); + + String expectedCodeMessage = "some smelly code goes here\n" + + "> void main(void** args) {\n" + + "> }"; + String codeAndTags = "*code\n" + expectedCodeMessage; + Message codeAndTagsMessage = commandsManager.processCommand(user, codeAndTags, emptyUri).getNewMessage().get(); + List codeAndTagsTags = codeAndTagsMessage.getTags(); + assertEquals("expected single tag", 1, + codeAndTagsTags.size()); + assertEquals("the single tag should be the 'code'", "code", + codeAndTagsTags.get(0).getName()); + assertEquals("and the message should be with a C-code and without tags", expectedCodeMessage, + codeAndTagsMessage.getText()); } @Test public void mailParserTest() throws Exception { -- cgit v1.2.3