add FileUtilTest test case (#672)

pull/673/head
liulinfei121 2 years ago committed by GitHub
parent 254c20e99f
commit 2d9191fa5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -27,4 +27,15 @@ public class FileUtilTest {
String contentByFileUtil = FileUtil.readUtf8String(testFilePath); String contentByFileUtil = FileUtil.readUtf8String(testFilePath);
Assert.notEmpty(contentByFileUtil); 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));
}
} }

Loading…
Cancel
Save