From b929d05156cdee2c28be06e6b1fe74d6a0e0ba4b Mon Sep 17 00:00:00 2001 From: Tim Reichen Date: Tue, 20 Aug 2024 01:38:22 +0200 Subject: [PATCH] test(yaml): add test for deprecated boolean syntax (#5713) * initial commit * Update yaml/stringify_test.ts * Update yaml/stringify_test.ts --------- Co-authored-by: Yoshiya Hinosawa --- yaml/stringify_test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/yaml/stringify_test.ts b/yaml/stringify_test.ts index 66cc83400..81fd1e9fa 100644 --- a/yaml/stringify_test.ts +++ b/yaml/stringify_test.ts @@ -668,6 +668,13 @@ Deno.test("stringify() handles string", () => { assertEquals(stringify("Hello World"), "Hello World\n"); }); +Deno.test("stringify() uses quotes around deprecated boolean notations when `compatMode: true`", () => { + assertEquals(stringify("On", { compatMode: true }), "'On'\n"); + assertEquals(stringify("Off", { compatMode: true }), "'Off'\n"); + assertEquals(stringify("Yes", { compatMode: true }), "'Yes'\n"); + assertEquals(stringify("No", { compatMode: true }), "'No'\n"); +}); + Deno.test("stringify() handles undefined with skipInvalid option", () => { assertEquals(stringify(undefined, { skipInvalid: true }), ""); });