From 510904fb2a9f233b5e18b35306b7cc6a74b626e4 Mon Sep 17 00:00:00 2001 From: Carleslc Date: Fri, 18 Mar 2022 20:24:45 +0100 Subject: [PATCH] Update resources with new examples --- .../examples/YamlCommentsFormatExample.java | 2 +- .../test/resources/test-comments-format.yml | 42 +++++++++++++++++++ .../src/test/resources/test-quote-style.yml | 5 +++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 Simple-Yaml/src/test/resources/test-comments-format.yml create mode 100644 Simple-Yaml/src/test/resources/test-quote-style.yml diff --git a/Simple-Yaml/src/test/java/org/simpleyaml/examples/YamlCommentsFormatExample.java b/Simple-Yaml/src/test/java/org/simpleyaml/examples/YamlCommentsFormatExample.java index d50dd5bd..bbe712b3 100644 --- a/Simple-Yaml/src/test/java/org/simpleyaml/examples/YamlCommentsFormatExample.java +++ b/Simple-Yaml/src/test/java/org/simpleyaml/examples/YamlCommentsFormatExample.java @@ -91,7 +91,7 @@ public static void main(String[] args) throws IOException { // You can also set a custom formatted comment directly prefixing all lines with # (raw) yamlFile.path("custom.raw").set("This is a nested key") - .comment("\n# ***\n#~ This is a multiline\n#~~ raw comment\n# ***\n", YamlCommentFormat.RAW); + .comment("\n# ***\n#~ This is a multiline\n#~~ custom raw comment\n# ***\n", YamlCommentFormat.RAW); // Save file yamlFile.save(); diff --git a/Simple-Yaml/src/test/resources/test-comments-format.yml b/Simple-Yaml/src/test/resources/test-comments-format.yml new file mode 100644 index 00000000..0af773c0 --- /dev/null +++ b/Simple-Yaml/src/test/resources/test-comments-format.yml @@ -0,0 +1,42 @@ +###################### +## HEADER COMMENT ## +###################### + +# This comment has a blank line above (header separator) +key-1: This is a root key + +# This comment has a blank line above (pretty format) +key-2: + # This comment does not have a blank line above + key-2-1: This is a nested key + + # This comment has a blank line above + key-2-2: This is a nested key + + # This comment has a blank line above + key-2-3: This is a nested key + +#--------------------# +# Custom block format +#--------------------# +custom: + #--------------------# + # This is a multiline + # comment without + # blank line above + #--------------------# + multiline: This is a nested key # Side comment + + #--------------------# + # This comment has + # a blank line above + # and custom format + #--------------------# + blank-line-custom: This is a nested key + + # *** + #~ This is a multiline + #~~ custom raw comment + # *** + + raw: This is a nested key diff --git a/Simple-Yaml/src/test/resources/test-quote-style.yml b/Simple-Yaml/src/test/resources/test-quote-style.yml new file mode 100644 index 00000000..b786f73e --- /dev/null +++ b/Simple-Yaml/src/test/resources/test-quote-style.yml @@ -0,0 +1,5 @@ +language: "EN" # English(EN), French(FR)... +string-list: + - "Hello" + - "World" +boolean: true