mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Fix null dereference in helpers.getPreferredLineEnding when running in browser (platform unknown, process object not available) and input string does not contain line endings.
This commit is contained in:
parent
580b7ed020
commit
295e481552
4 changed files with 51 additions and 3 deletions
|
|
@ -390,6 +390,14 @@ test("forEachInlineCodeSpan", (t) => {
|
|||
});
|
||||
});
|
||||
|
||||
test("getPlatformIdentifier", (t) => {
|
||||
t.plan(4);
|
||||
t.is(helpers.getPlatformIdentifier("custom", process), "custom");
|
||||
t.is(helpers.getPlatformIdentifier("custom", null), "custom");
|
||||
t.is(helpers.getPlatformIdentifier(null, process), process.platform);
|
||||
t.is(helpers.getPlatformIdentifier(null, null), "unknown");
|
||||
});
|
||||
|
||||
test("getPreferredLineEnding", (t) => {
|
||||
t.plan(19);
|
||||
const testCases = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue