fix test file

This commit is contained in:
Looly 2025-01-03 22:26:15 +08:00
parent 51cd14a0ec
commit 23f2f210f3
7 changed files with 20 additions and 46 deletions

View File

@ -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<String> 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<String> list = ListUtil.of(lineReader);
Assertions.assertEquals(3, list.size());
Assertions.assertEquals("test1", list.get(0));

View File

@ -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<String> 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<String> strings = fileReader.readLines(new ArrayList<>(), StrUtil::isNotBlank);
Assertions.assertEquals(5, strings.size());
}

View File

@ -0,0 +1,6 @@
#--------------------------------------------
# 配置文件测试
#--------------------------------------------
a = 1
b = 2

View File

@ -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

View File

@ -0,0 +1,5 @@
test1
test2=a\
bc\
d\\e
test3=abc

View File

@ -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

View File

@ -0,0 +1,5 @@
test1
test2=a\
bc\
d\\e
test3=abc