From cac6c0ef35d24afa5638d051886a6b553fee7f37 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Mon, 11 May 2020 14:54:24 +1200 Subject: [PATCH] Add newline splitter test --- .../disguise/utilities/DisguiseUtilitiesTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/java/me/libraryaddict/disguise/utilities/DisguiseUtilitiesTest.java b/src/test/java/me/libraryaddict/disguise/utilities/DisguiseUtilitiesTest.java index 7073a952..5bc45911 100644 --- a/src/test/java/me/libraryaddict/disguise/utilities/DisguiseUtilitiesTest.java +++ b/src/test/java/me/libraryaddict/disguise/utilities/DisguiseUtilitiesTest.java @@ -9,6 +9,17 @@ import java.util.Arrays; * Created by libraryaddict on 25/10/2018. */ public class DisguiseUtilitiesTest { + @Test + public void testNewlineSplitter() { + Assert.assertArrayEquals(new String[]{"Name 1", "Name 2"}, DisguiseUtilities.splitNewLine("Name 1\nName 2")); + Assert.assertArrayEquals(new String[]{"Name 1", "Name 2"}, DisguiseUtilities.splitNewLine("Name 1\\nName 2")); + Assert.assertArrayEquals(new String[]{"Name 1\\", "Name 2"}, + DisguiseUtilities.splitNewLine("Name 1\\\nName 2")); + Assert.assertArrayEquals(new String[]{"Name 1\\nName 2"}, DisguiseUtilities.splitNewLine("Name 1\\\\nName 2")); + Assert.assertArrayEquals(new String[]{"Name 1\\","Name 2"}, DisguiseUtilities.splitNewLine("Name 1\\\\\\nName 2")); + Assert.assertArrayEquals(new String[]{"Name 1\\\\nName 2"}, DisguiseUtilities.splitNewLine("Name 1\\\\\\\\nName 2")); + } + @Test public void testQuoteSplitter() { // Test if splits are correct