Fixed tests

This commit is contained in:
Auxilor
2022-02-28 14:24:10 +00:00
parent 337c5d2b84
commit 19ce4c56a9
3 changed files with 4 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
import com.willfp.eco.util.StringUtils;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class StringUtilsTest {
@Test
public void testSplitAround() {
Assertions.assertArrayEquals(
new String[]{"one", "two"},
StringUtils.splitAround("one ? two", "?")
);
Assertions.assertArrayEquals(
new String[]{"one? two"},
StringUtils.splitAround("one? two", "?")
);
Assertions.assertArrayEquals(
new String[]{"one", "two", "three"},
StringUtils.splitAround("one ? two ? three", "?")
);
Assertions.assertArrayEquals(
new String[]{"one", "two"},
StringUtils.splitAround("one || two", "||")
);
Assertions.assertArrayEquals(
new String[]{"one|| two"},
StringUtils.splitAround("one|| two", "||")
);
}
}