From 66d29e2a11cd8b07763f70d27f5ef0b5b5174082 Mon Sep 17 00:00:00 2001 From: Brandon Mills Date: Tue, 8 Oct 2019 02:37:03 -0400 Subject: [PATCH] Chore: Test multline autofix with CRLF Originally discovered in #120 and cherry-picked from #125. --- tests/lib/plugin.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/lib/plugin.js b/tests/lib/plugin.js index f187d5e5..c889d797 100644 --- a/tests/lib/plugin.js +++ b/tests/lib/plugin.js @@ -597,6 +597,33 @@ describe("plugin", () => { assert.strictEqual(actual, expected); }); + it("with multiline autofix and CRLF", () => { + const input = [ + "This is Markdown.", + "", + "```js", + "console.log('Hello, \\", + "world!')", + "console.log('Hello, \\", + "world!')", + "```" + ].join("\r\n"); + const expected = [ + "This is Markdown.", + "", + "```js", + "console.log(\"Hello, \\", + "world!\")", + "console.log(\"Hello, \\", + "world!\")", + "```" + ].join("\r\n"); + const report = cli.executeOnText(input, "test.md"); + const actual = report.results[0].output; + + assert.strictEqual(actual, expected); + }); + // https://spec.commonmark.org/0.28/#fenced-code-blocks describe("when indented", () => { it("by one space", () => {