diff --git a/hutool-core/src/test/java/org/dromara/hutool/core/io/LineReaderTest.java b/hutool-core/src/test/java/org/dromara/hutool/core/io/LineReaderTest.java index ad6d6f7f2..8d4a80c29 100644 --- a/hutool-core/src/test/java/org/dromara/hutool/core/io/LineReaderTest.java +++ b/hutool-core/src/test/java/org/dromara/hutool/core/io/LineReaderTest.java @@ -26,7 +26,7 @@ import java.util.ArrayList; public class LineReaderTest { @Test public void readLfTest() { - final LineReader lineReader = new LineReader(ResourceUtil.getUtf8Reader("multi_line.properties")); + final LineReader lineReader = new LineReader(ResourceUtil.getUtf8Reader("multi_line.txt")); final ArrayList list = ListUtil.of(lineReader); Assertions.assertEquals(3, list.size()); Assertions.assertEquals("test1", list.get(0)); @@ -36,7 +36,7 @@ public class LineReaderTest { @Test public void readCrLfTest() { - final LineReader lineReader = new LineReader(ResourceUtil.getUtf8Reader("multi_line_crlf.properties")); + final LineReader lineReader = new LineReader(ResourceUtil.getUtf8Reader("multi_line_crlf.txt")); final ArrayList list = ListUtil.of(lineReader); Assertions.assertEquals(3, list.size()); Assertions.assertEquals("test1", list.get(0)); diff --git a/hutool-core/src/test/java/org/dromara/hutool/core/io/file/FileReaderTest.java b/hutool-core/src/test/java/org/dromara/hutool/core/io/file/FileReaderTest.java index 875a7ee8c..6740ce7f5 100644 --- a/hutool-core/src/test/java/org/dromara/hutool/core/io/file/FileReaderTest.java +++ b/hutool-core/src/test/java/org/dromara/hutool/core/io/file/FileReaderTest.java @@ -39,14 +39,14 @@ public class FileReaderTest { @Test public void readLinesTest() { - final FileReader fileReader = FileReader.of(FileUtil.file("test.properties")); + final FileReader fileReader = FileReader.of(FileUtil.file("file_reader_test.txt")); final List strings = fileReader.readLines(); Assertions.assertEquals(6, strings.size()); } @Test public void readLinesTest2() { - final FileReader fileReader = FileReader.of(FileUtil.file("test.properties")); + final FileReader fileReader = FileReader.of(FileUtil.file("file_reader_test.txt")); final List strings = fileReader.readLines(new ArrayList<>(), StrUtil::isNotBlank); Assertions.assertEquals(5, strings.size()); } diff --git a/hutool-core/src/test/resources/file_reader_test.txt b/hutool-core/src/test/resources/file_reader_test.txt new file mode 100644 index 000000000..a446e547f --- /dev/null +++ b/hutool-core/src/test/resources/file_reader_test.txt @@ -0,0 +1,6 @@ +#-------------------------------------------- +# 配置文件测试 +#-------------------------------------------- + +a = 1 +b = 2 diff --git a/hutool-core/src/test/resources/multi_line.properties b/hutool-core/src/test/resources/multi_line.properties deleted file mode 100755 index e06d2e75e..000000000 --- a/hutool-core/src/test/resources/multi_line.properties +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright (c) 2025 Hutool Team and hutool.cn -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -test1 -test2=a\ - bc\ - d\\e -test3=abc diff --git a/hutool-core/src/test/resources/multi_line.txt b/hutool-core/src/test/resources/multi_line.txt new file mode 100644 index 000000000..432d0997a --- /dev/null +++ b/hutool-core/src/test/resources/multi_line.txt @@ -0,0 +1,5 @@ +test1 +test2=a\ + bc\ + d\\e +test3=abc diff --git a/hutool-core/src/test/resources/multi_line_crlf.properties b/hutool-core/src/test/resources/multi_line_crlf.properties deleted file mode 100755 index ae97ac483..000000000 --- a/hutool-core/src/test/resources/multi_line_crlf.properties +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright (c) 2025 Hutool Team and hutool.cn -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -test1 -test2=a\ - bc\ - d\\e -test3=abc diff --git a/hutool-core/src/test/resources/multi_line_crlf.txt b/hutool-core/src/test/resources/multi_line_crlf.txt new file mode 100644 index 000000000..12b8b1c9a --- /dev/null +++ b/hutool-core/src/test/resources/multi_line_crlf.txt @@ -0,0 +1,5 @@ +test1 +test2=a\ + bc\ + d\\e +test3=abc