From e8b0adab2aecc233a090f98c569931871f977ba4 Mon Sep 17 00:00:00 2001 From: makc Date: Thu, 29 Jul 2021 12:01:52 +0200 Subject: better hashtags https://juick.com/rm/2997070#7 --- src/test/java/com/juick/server/tests/ServerTests.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/test/java/com/juick/server/tests') diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index 795415be..c37d70bc 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -436,6 +436,18 @@ public class ServerTests { messagesService.deleteMessage(user.getUid(), mid4); } + @Test + public void tagParsingTests() { + assertEquals(0, tagService.fromString("*").getRight().size()); + assertEquals(1, tagService.fromString("*kek").getRight().size()); + assertEquals(1, tagService.fromString("*123").getRight().size()); + assertEquals(0, tagService.fromString("#").getRight().size()); + assertEquals(1, tagService.fromString("#kek").getRight().size()); + assertEquals(1, tagService.fromString("#12k").getRight().size()); + assertEquals(0, tagService.fromString("#123").getRight().size()); + assertEquals(2, tagService.fromString("#mixed *tags #123 test").getRight().size()); + } + @Test public void likeTypeStatsTests() { User dsdss = userService.createUser("dsdss", "secret").orElseThrow(IllegalStateException::new); -- cgit v1.2.3