|
|
|
@ -27,4 +27,15 @@ public class FileUtilTest {
|
|
|
|
|
String contentByFileUtil = FileUtil.readUtf8String(testFilePath);
|
|
|
|
|
Assert.notEmpty(contentByFileUtil);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void assertReadUtf8String2() {
|
|
|
|
|
String linebreaks = System.getProperty("line.separator");
|
|
|
|
|
String testText = "abcd简体繁体\uD83D\uDE04\uD83D\uDD25& *" + linebreaks +
|
|
|
|
|
"second line" + linebreaks +
|
|
|
|
|
"empty line next" + linebreaks;
|
|
|
|
|
String testFilePath = "test/test_utf8.txt";
|
|
|
|
|
String contentByFileUtil = FileUtil.readUtf8String(testFilePath);
|
|
|
|
|
Assert.isTrue(testText.equals(contentByFileUtil));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|