mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
package org.dromara.hutool.core.array;
|
||||
|
||||
import org.dromara.hutool.core.collection.ListUtil;
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
import org.dromara.hutool.core.util.ObjUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
@@ -551,6 +552,14 @@ public class ArrayUtilTest {
|
||||
Assertions.assertArrayEquals(new int[]{2}, o);
|
||||
}
|
||||
|
||||
@Test
|
||||
void setOrPaddingTest(){
|
||||
final String[] arr = new String[0];
|
||||
final String[] newArr = ArrayUtil.setOrPadding(arr, 2, "Good");
|
||||
Console.log(newArr);
|
||||
Assertions.assertArrayEquals(new String[]{null, null, "Good"}, newArr);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAnyTest() {
|
||||
final String[] a = {"a", "b", "c", "d", "e"};
|
||||
|
@@ -148,6 +148,15 @@ public class BeanPathTest {
|
||||
Assertions.assertEquals("{list=[[null, {name=张三}]]}", map.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void putTest() {
|
||||
final Map<String, Object> map = new HashMap<>();
|
||||
|
||||
BeanPath beanPath = BeanPath.of("list[1].name");
|
||||
beanPath.set(map, "张三");
|
||||
Assertions.assertEquals("{list=[null, {name=张三}]}", map.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void putByPathTest() {
|
||||
final Dict dict = new Dict();
|
||||
|
Reference in New Issue
Block a user