mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add test
This commit is contained in:
parent
dfbdb92d61
commit
6468a0446d
@ -1321,8 +1321,7 @@ public class ArrayUtil extends PrimitiveArrayUtil {
|
||||
* @return 变更后的原数组
|
||||
* @since 3.0.9
|
||||
*/
|
||||
public static <T> T[]
|
||||
reverse(T[] array, final int startIndexInclusive, final int endIndexExclusive) {
|
||||
public static <T> T[] reverse(T[] array, final int startIndexInclusive, final int endIndexExclusive) {
|
||||
if (isEmpty(array)) {
|
||||
return array;
|
||||
}
|
||||
|
@ -409,6 +409,13 @@ public class ArrayUtilTest {
|
||||
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
|
||||
public void removeEmptyTest() {
|
||||
String[] a = {"a", "b", "", null, " ", "c"};
|
||||
|
Loading…
x
Reference in New Issue
Block a user