X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FSoneTextParserTest.java;h=3b6ac4a11c200f1d80a87c73d662e8de53728963;hp=b630ac5f257abbd1e00aa3523e0278b45cc4fad2;hb=e484183c582bfa805a4f5eabae8e3c97cacde97e;hpb=16b7ecd68873178d79b81023fc702d61d7696e13 diff --git a/src/test/java/net/pterodactylus/sone/text/SoneTextParserTest.java b/src/test/java/net/pterodactylus/sone/text/SoneTextParserTest.java index b630ac5..3b6ac4a 100644 --- a/src/test/java/net/pterodactylus/sone/text/SoneTextParserTest.java +++ b/src/test/java/net/pterodactylus/sone/text/SoneTextParserTest.java @@ -53,17 +53,17 @@ public class SoneTextParserTest extends TestCase { Iterable parts; /* check basic operation. */ - parts = soneTextParser.parse(null, "Test."); + parts = soneTextParser.parse("Test.", null); assertNotNull("Parts", parts); assertEquals("Part Text", "Test.", convertText(parts, PlainTextPart.class)); /* check empty lines at start and end. */ - parts = soneTextParser.parse(null, "\nTest.\n\n"); + parts = soneTextParser.parse("\nTest.\n\n", null); assertNotNull("Parts", parts); assertEquals("Part Text", "Test.", convertText(parts, PlainTextPart.class)); /* check duplicate empty lines in the text. */ - parts = soneTextParser.parse(null, "\nTest.\n\n\nTest."); + parts = soneTextParser.parse("\nTest.\n\n\nTest.", null); assertNotNull("Parts", parts); assertEquals("Part Text", "Test.\n\nTest.", convertText(parts, PlainTextPart.class)); } @@ -80,17 +80,17 @@ public class SoneTextParserTest extends TestCase { Iterable parts; /* check basic links. */ - parts = soneTextParser.parse(null, "KSK@gpl.txt"); + parts = soneTextParser.parse("KSK@gpl.txt", null); assertNotNull("Parts", parts); assertEquals("Part Text", "[KSK@gpl.txt|gpl.txt|gpl.txt]", convertText(parts, FreenetLinkPart.class)); /* check embedded links. */ - parts = soneTextParser.parse(null, "Link is KSK@gpl.txt\u200b."); + parts = soneTextParser.parse("Link is KSK@gpl.txt\u200b.", null); assertNotNull("Parts", parts); assertEquals("Part Text", "Link is [KSK@gpl.txt|gpl.txt|gpl.txt]\u200b.", convertText(parts, PlainTextPart.class, FreenetLinkPart.class)); /* check embedded links and line breaks. */ - parts = soneTextParser.parse(null, "Link is KSK@gpl.txt\nKSK@test.dat\n"); + parts = soneTextParser.parse("Link is KSK@gpl.txt\nKSK@test.dat\n", null); assertNotNull("Parts", parts); assertEquals("Part Text", "Link is [KSK@gpl.txt|gpl.txt|gpl.txt]\n[KSK@test.dat|test.dat|test.dat]", convertText(parts, PlainTextPart.class, FreenetLinkPart.class)); } @@ -107,7 +107,7 @@ public class SoneTextParserTest extends TestCase { Iterable parts; /* check basic links. */ - parts = soneTextParser.parse(null, "Some text.\n\nLink to sone://DAxKQzS48mtaQc7sUVHIgx3fnWZPQBz0EueBreUVWrU and stuff."); + parts = soneTextParser.parse("Some text.\n\nLink to sone://DAxKQzS48mtaQc7sUVHIgx3fnWZPQBz0EueBreUVWrU and stuff.", null); assertNotNull("Parts", parts); assertEquals("Part Text", "Some text.\n\nLink to [Sone|DAxKQzS48mtaQc7sUVHIgx3fnWZPQBz0EueBreUVWrU] and stuff.", convertText(parts, PlainTextPart.class, SonePart.class)); } @@ -125,7 +125,7 @@ public class SoneTextParserTest extends TestCase { Iterable parts; /* check empty http links. */ - parts = soneTextParser.parse(null, "Some text. Empty link: http:// – nice!"); + parts = soneTextParser.parse("Some text. Empty link: http:// – nice!", null); assertNotNull("Parts", parts); assertEquals("Part Text", "Some text. Empty link: http:// – nice!", convertText(parts, PlainTextPart.class)); }