This commit is contained in:
Looly 2024-01-24 18:11:46 +08:00
parent f368a0a0d2
commit 694168a3cb

View File

@ -829,6 +829,20 @@ public class ArrayUtilTest {
new String(a.getBytes(CharsetUtil.UTF_8), 1, 4));
}
@Test
void copyTest() {
final String[] dest = new String[3];
ArrayUtil.copy(new String[]{"a", "b"}, dest);
Assertions.assertArrayEquals(new String[]{"a", "b", null}, dest);
}
@Test
void copyTest2() {
final String[] dest = new String[3];
ArrayUtil.copy(new String[]{"a", "b"}, dest, 1);
Assertions.assertArrayEquals(new String[]{"a", null, null}, dest);
}
@Test
public void regionMatchesTest() {
final byte[] a = new byte[]{1, 2, 3, 4, 5};