mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add test
This commit is contained in:
@@ -1321,8 +1321,7 @@ public class ArrayUtil extends PrimitiveArrayUtil {
|
|||||||
* @return 变更后的原数组
|
* @return 变更后的原数组
|
||||||
* @since 3.0.9
|
* @since 3.0.9
|
||||||
*/
|
*/
|
||||||
public static <T> T[]
|
public static <T> T[] reverse(T[] array, final int startIndexInclusive, final int endIndexExclusive) {
|
||||||
reverse(T[] array, final int startIndexInclusive, final int endIndexExclusive) {
|
|
||||||
if (isEmpty(array)) {
|
if (isEmpty(array)) {
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
@@ -409,6 +409,13 @@ public class ArrayUtilTest {
|
|||||||
Assert.assertArrayEquals(new int[]{4,3,2,1}, reverse);
|
Assert.assertArrayEquals(new int[]{4,3,2,1}, reverse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void reverseTest2s(){
|
||||||
|
Object[] a = {"1",'2',"3",4};
|
||||||
|
final Object[] reverse = ArrayUtil.reverse(a);
|
||||||
|
Assert.assertArrayEquals(new Object[]{4,"3",'2',"1"}, reverse);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void removeEmptyTest() {
|
public void removeEmptyTest() {
|
||||||
String[] a = {"a", "b", "", null, " ", "c"};
|
String[] a = {"a", "b", "", null, " ", "c"};
|
||||||
|
Reference in New Issue
Block a user