X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FSoneTextParserTest.java;h=0daf94444d247b8cfefa74532a5e3ab941604036;hp=e640c7d9e8b4ef338155d2b0097191d6c0dc2cfc;hb=7d52ecea5a10feaae9fcd86415a3c6f41edc72fa;hpb=b50431949441894198b9f310cd07f2bdcf7231de diff --git a/src/test/java/net/pterodactylus/sone/text/SoneTextParserTest.java b/src/test/java/net/pterodactylus/sone/text/SoneTextParserTest.java index e640c7d..0daf944 100644 --- a/src/test/java/net/pterodactylus/sone/text/SoneTextParserTest.java +++ b/src/test/java/net/pterodactylus/sone/text/SoneTextParserTest.java @@ -93,6 +93,13 @@ public class SoneTextParserTest { } @Test + public void soneAndPostCanBeParsedFromTheSameText() { + SoneTextParser parser = new SoneTextParser(new TestSoneProvider(), new TestPostProvider()); + Iterable parts = parser.parse("Text sone://DAxKQzS48mtaQc7sUVHIgx3fnWZPQBz0EueBreUVWrU more text post://f3757817-b45a-497a-803f-9c5aafc10dc6 even more text", null); + assertThat("Part Text", convertText(parts), is("Text [Sone|DAxKQzS48mtaQc7sUVHIgx3fnWZPQBz0EueBreUVWrU] more text [Post|f3757817-b45a-497a-803f-9c5aafc10dc6|text] even more text")); + } + + @Test public void postLinkIsRenderedAsPlainTextIfPostIdIsTooShort() { Iterable parts = soneTextParser.parse("post://too-short", null); assertThat("Part Text", convertText(parts), is("post://too-short"));