mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package cn.hutool.core.compress;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.file.FileUtil;
|
||||
import cn.hutool.core.io.resource.FileResource;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import org.junit.Ignore;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package cn.hutool.core.convert;
|
||||
|
||||
import cn.hutool.core.convert.impl.ArrayConverter;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.file.FileUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package cn.hutool.core.io;
|
||||
|
||||
import cn.hutool.core.io.file.FileTypeUtil;
|
||||
import cn.hutool.core.io.file.FileUtil;
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import org.junit.Assert;
|
||||
@@ -85,4 +87,11 @@ public class FileTypeUtilTest {
|
||||
final String type = FileTypeUtil.getType(inputStream);
|
||||
Console.log(type);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void issueI6MACITest() {
|
||||
final File file = FileUtil.file("text.txt");
|
||||
final String type = FileTypeUtil.getType(file);
|
||||
Assert.assertEquals("txt", type);
|
||||
}
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ package cn.hutool.core.io;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.io.file.FileNameUtil;
|
||||
import cn.hutool.core.io.file.FileUtil;
|
||||
import cn.hutool.core.io.file.LineSeparator;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package cn.hutool.core.io;
|
||||
|
||||
import cn.hutool.core.io.file.FileUtil;
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.core.io.stream.EmptyOutputStream;
|
||||
import cn.hutool.core.lang.Console;
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.hutool.core.io.file;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.hutool.core.io.file;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package cn.hutool.core.io.file;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
@@ -3,7 +3,6 @@ package cn.hutool.core.io.file;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
|
||||
public class TailerTest {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.hutool.core.io.resource;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.file.FileUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.text.StrUtil;
|
||||
import org.junit.Assert;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.hutool.core.thread;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.file.FileUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.util.RuntimeUtil;
|
||||
|
||||
|
@@ -617,7 +617,7 @@ public class ArrayUtilTest {
|
||||
@Test
|
||||
public void subTest() {
|
||||
final int[] arr = {1, 2, 3, 4, 5};
|
||||
int[] empty = new int[0];
|
||||
final int[] empty = new int[0];
|
||||
Assert.assertArrayEquals(empty, ArrayUtil.sub(arr, 2, 2));
|
||||
Assert.assertArrayEquals(empty, ArrayUtil.sub(arr, 5, 5));
|
||||
Assert.assertArrayEquals(empty, ArrayUtil.sub(arr, 5, 7));
|
||||
@@ -689,4 +689,34 @@ public class ArrayUtilTest {
|
||||
Assert.assertTrue(ArrayUtil.hasSameElement(e));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startWithTest() {
|
||||
boolean b = ArrayUtil.startWith(new String[]{}, new String[]{});
|
||||
Assert.assertTrue(b);
|
||||
|
||||
b = ArrayUtil.startWith(new String[]{"1", "2", "3"}, new String[]{"1"});
|
||||
Assert.assertTrue(b);
|
||||
|
||||
b = ArrayUtil.startWith(new String[]{"1"}, new String[]{"1"});
|
||||
Assert.assertTrue(b);
|
||||
|
||||
b = ArrayUtil.startWith((String[])null, null);
|
||||
Assert.assertTrue(b);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startWithTest2() {
|
||||
boolean b = ArrayUtil.startWith(new int[]{}, new int[]{});
|
||||
Assert.assertTrue(b);
|
||||
|
||||
b = ArrayUtil.startWith(new int[]{1,2,3}, new int[]{1});
|
||||
Assert.assertTrue(b);
|
||||
|
||||
b = ArrayUtil.startWith(new int[]{1}, new int[]{1});
|
||||
Assert.assertTrue(b);
|
||||
|
||||
b = ArrayUtil.startWith((int[])null, null);
|
||||
Assert.assertTrue(b);
|
||||
}
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@ package cn.hutool.core.util;
|
||||
|
||||
import cn.hutool.core.compress.ZipReader;
|
||||
import cn.hutool.core.compress.ZipUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.file.FileUtil;
|
||||
import cn.hutool.core.io.IORuntimeException;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.text.StrUtil;
|
||||
|
Reference in New Issue
Block a user