mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
test(yaml): add undefined object entry with skipInvalid and flowLevel option test (#5829)
This commit is contained in:
parent
0ebec10450
commit
3946983d7c
@ -698,3 +698,32 @@ Deno.test("stringify() returns emtpy array on invalid entries", () => {
|
||||
"[]\n",
|
||||
);
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name:
|
||||
"stringify() handles undefined object entry with skipInvalid and flowLevel option",
|
||||
fn() {
|
||||
assertEquals(
|
||||
stringify({ foo: { bar: undefined } }, {
|
||||
flowLevel: 1,
|
||||
skipInvalid: true,
|
||||
}),
|
||||
`foo: {}\n`,
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name:
|
||||
"stringify() handles undefined object entry with big key and skipInvalid and flowLevel option",
|
||||
fn() {
|
||||
const key = "a".repeat(1025);
|
||||
assertEquals(
|
||||
stringify({ [key]: { bar: undefined } }, {
|
||||
flowLevel: 1,
|
||||
skipInvalid: true,
|
||||
}),
|
||||
`? aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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