mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix indexOfSub bug
This commit is contained in:
@@ -356,6 +356,14 @@ public class ArrayUtilTest {
|
||||
Assert.assertEquals(-1, i);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void indexOfSubTest2(){
|
||||
Integer[] a = {0x12, 0x56, 0x34, 0x56, 0x78, 0x9A};
|
||||
Integer[] b = {0x56, 0x78};
|
||||
int i = ArrayUtil.indexOfSub(a, b);
|
||||
Assert.assertEquals(3, i);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void lastIndexOfSubTest() {
|
||||
Integer[] a = {0x12, 0x34, 0x56, 0x78, 0x9A};
|
||||
@@ -386,6 +394,14 @@ public class ArrayUtilTest {
|
||||
Assert.assertEquals(-1, i);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void lastIndexOfSubTest2(){
|
||||
Integer[] a = {0x12, 0x56, 0x78, 0x56, 0x21, 0x9A};
|
||||
Integer[] b = {0x56, 0x78};
|
||||
int i = ArrayUtil.indexOfSub(a, b);
|
||||
Assert.assertEquals(1, i);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void reverseTest(){
|
||||
int[] a = {1,2,3,4};
|
||||
|
Reference in New Issue
Block a user