Use text block where feasible

See gh-31916
This commit is contained in:
Yanming Zhou
2023-12-28 15:04:50 +08:00
committed by Stéphane Nicoll
parent 9d31537ae5
commit a35384fd57
9 changed files with 93 additions and 41 deletions

View File

@@ -58,9 +58,10 @@ public class PropertiesEditorTests {
@Test
public void handlesEqualsInValue() {
String s = "foo=bar\n" +
"me=mi\n" +
"x=y=z";
String s = """
foo=bar
me=mi
x=y=z""";
PropertiesEditor pe= new PropertiesEditor();
pe.setAsText(s);
Properties p = (Properties) pe.getValue();
@@ -98,12 +99,14 @@ public class PropertiesEditorTests {
*/
@Test
public void ignoresCommentLinesAndEmptyLines() {
String s = "#Ignore this comment\n" +
"foo=bar\n" +
"#Another=comment more junk /\n" +
"me=mi\n" +
"x=x\n" +
"\n";
String s = """
#Ignore this comment
foo=bar
#Another=comment more junk /
me=mi
x=x
""";
PropertiesEditor pe= new PropertiesEditor();
pe.setAsText(s);
Properties p = (Properties) pe.getValue();