Skip to content

Commit

Permalink
[Port from snakeyaml-engine] Test comment reproducibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
krzema12 and dejvokep committed Nov 8, 2024
1 parent 80b7a19 commit 9875e63
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,16 @@ public void testCommentsIndentFirstLineBlank() throws Exception {
assertEquals(data, result);
}

@Test
public void testCommentsLineBlank() throws Exception {
String data = "# Comment 1\n" + "key1:\n" + " \n" + " # Comment 2\n" + "\n" + " # Comment 3\n" + "\n"
+ " key2: value1\n" + "# \"Fun\" options\n" + "key3:\n" + " # Comment 4\n"
+ " # Comment 5\n" + " key4: value2\n" + "key5:\n" + " key6: value3\n";

String result = runEmitterWithCommentsEnabled(data);
assertEquals(data, result);
}

@Test
public void testMultiLineString() throws Exception {
String data = "# YAML load and save bug with keep block chomping indicator\n" + "example:\n"
Expand Down
2 changes: 1 addition & 1 deletion upstream-commit.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8af4b3befe5ede130782db3386e1b370aded3104
cf808a16bff0eb531a48debcd04be0aab562c21e

0 comments on commit 9875e63

Please sign in to comment.