Skip to content

Commit

Permalink
test(yaml): test stringify() case when string encoded into hex sequ…
Browse files Browse the repository at this point in the history
…ences (#5230)
  • Loading branch information
kt3k authored Jul 1, 2024
1 parent d753d4b commit 442b018
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions yaml/stringify_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,13 @@ Deno.test({
);
},
});

Deno.test({
name: "stringify() encode string with special characters",
fn() {
assertEquals(stringify("\x03"), `"\\x03"\n`);
assertEquals(stringify("\x08"), `"\\b"\n`);
assertEquals(stringify("\uffff"), `"\\uFFFF"\n`);
assertEquals(stringify("🐱"), `"\\U0001F431"\n`);
},
});

0 comments on commit 442b018

Please sign in to comment.