Add newline splitter test

This commit is contained in:
libraryaddict 2020-05-11 14:54:24 +12:00
parent 9a40df5bd8
commit cac6c0ef35
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4

View File

@ -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