mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Refactor/simplify helpers.getPreferredLineEnding to use os.EOL instead of process.platform.
This commit is contained in:
parent
19dfb960f1
commit
a8f946e0b3
4 changed files with 17 additions and 37 deletions
|
|
@ -415,26 +415,10 @@ test("getPreferredLineEnding", (t) => {
|
|||
const actual = helpers.getPreferredLineEnding(input);
|
||||
t.is(actual, expected, "Incorrect line ending returned.");
|
||||
});
|
||||
t.is(
|
||||
helpers.getPreferredLineEnding(""),
|
||||
"\n",
|
||||
"Incorrect line ending for undefined platform"
|
||||
);
|
||||
t.is(
|
||||
helpers.getPreferredLineEnding("", { "platform": "darwin" }),
|
||||
"\n",
|
||||
"Incorrect line ending for darwin"
|
||||
);
|
||||
t.is(
|
||||
helpers.getPreferredLineEnding("", { "platform": "linux" }),
|
||||
"\n",
|
||||
"Incorrect line ending for linux"
|
||||
);
|
||||
t.is(
|
||||
helpers.getPreferredLineEnding("", { "platform": "win32" }),
|
||||
"\r\n",
|
||||
"Incorrect line ending for win32"
|
||||
);
|
||||
t.is(helpers.getPreferredLineEnding("", null), "\n");
|
||||
t.is(helpers.getPreferredLineEnding("", { "EOL": "\n" }), "\n");
|
||||
t.is(helpers.getPreferredLineEnding("", { "EOL": "\r\n" }), "\r\n");
|
||||
t.is(helpers.getPreferredLineEnding("", { "EOL": "custom" }), "custom");
|
||||
});
|
||||
|
||||
test("applyFix", (t) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue