mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-12-06 09:09:10 +08:00
Compare commits
2 Commits
5b2b2c6ef3
...
a3a7622419
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3a7622419 | ||
|
|
1fac9525ab |
@ -95,6 +95,11 @@
|
||||
<artifactId>hutool-swing</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.parent.groupId}</groupId>
|
||||
<artifactId>hutool-ai</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
@ -147,6 +152,10 @@
|
||||
<groupId>${project.parent.groupId}</groupId>
|
||||
<artifactId>hutool-swing</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.parent.groupId}</groupId>
|
||||
<artifactId>hutool-ai</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
package cn.hutool.v7.core.io.file;
|
||||
|
||||
import cn.hutool.v7.core.io.IORuntimeException;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class Issue4121Test {
|
||||
@Test
|
||||
void testListFileNames_NonExistentDirectory() {
|
||||
assertThrows(IORuntimeException.class, () -> {
|
||||
FileUtil.listFileNames("/non/existent/path");
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void testListFileNames_RelativePath() {
|
||||
// 测试相对路径(相对于classpath)
|
||||
List<String> result = FileUtil.listFileNames("META-INF");
|
||||
|
||||
assertEquals(3, result.size());
|
||||
assertTrue(result.contains("MANIFEST.MF"));
|
||||
assertTrue(result.contains("LICENSE-notice.md"));
|
||||
assertTrue(result.contains("LICENSE.md"));
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user