feat: 准备 1.3.0 稳定版本
This commit is contained in:
@@ -58,4 +58,19 @@ class AtomicYamlWriterTest {
|
||||
|
||||
assertTrue(YamlConfiguration.loadConfiguration(target.toFile()).getBoolean("written"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void preservesParsedChineseComments() throws Exception {
|
||||
Path target = temporaryDirectory.resolve("commented.yml");
|
||||
YamlConfiguration configuration = new YamlConfiguration();
|
||||
configuration.options().parseComments(true);
|
||||
configuration.loadFromString("# 中文配置注释\nenabled: false\n");
|
||||
configuration.set("enabled", true);
|
||||
|
||||
AtomicYamlWriter.save(configuration, target.toFile());
|
||||
|
||||
String saved = Files.readString(target, StandardCharsets.UTF_8);
|
||||
assertTrue(saved.contains("# 中文配置注释"));
|
||||
assertTrue(saved.contains("enabled: true"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user