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
b2e5edb990
commit
6b60aef692
@ -21,8 +21,7 @@ import org.junit.jupiter.api.Test;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link ArrayUtil} 数组工具单元测试
|
* {@link ArrayUtil} 数组工具单元测试
|
||||||
@ -555,7 +554,7 @@ public class ArrayUtilTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void reverseTest2s() {
|
public void reverseTest2() {
|
||||||
final Object[] a = {"1", '2', "3", 4};
|
final Object[] a = {"1", '2', "3", 4};
|
||||||
final Object[] reverse = ArrayUtil.reverse(a);
|
final Object[] reverse = ArrayUtil.reverse(a);
|
||||||
assertArrayEquals(new Object[]{4, "3", '2', "1"}, reverse);
|
assertArrayEquals(new Object[]{4, "3", '2', "1"}, reverse);
|
||||||
@ -1071,4 +1070,12 @@ public class ArrayUtilTest {
|
|||||||
assertEquals(5, resizedArray.length);
|
assertEquals(5, resizedArray.length);
|
||||||
assertArrayEquals(new Integer[]{1, 2, 3, null, null}, resizedArray);
|
assertArrayEquals(new Integer[]{1, 2, 3, null, null}, resizedArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testShuffleNotSameAsOriginal() {
|
||||||
|
final Integer[] initialArray = new Integer[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||||
|
final Integer[] shuffledArray = ArrayUtil.shuffle(initialArray.clone());
|
||||||
|
|
||||||
|
assertNotEquals(Arrays.toString(initialArray), Arrays.toString(shuffledArray));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user