Skip to content

Commit

Permalink
test(yaml): test block scalar output of stringify (#5341)
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k authored Jul 8, 2024
1 parent 1a637a7 commit 01587e3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions yaml/stringify_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,23 @@ Deno.test({
);
},
});

Deno.test({
name: "stringify() uses block scalar style for multiline strings",
fn() {
assertEquals(
stringify("foo\nbar"),
`|-
foo
bar
`,
);
assertEquals(
stringify("foo \nbar "),
`|-
foo \x20
bar \x20
`,
);
},
});

0 comments on commit 01587e3

Please sign in to comment.