diff --git a/test/long-lines-negative-line-length.md b/test/long-lines-negative-line-length.md new file mode 100644 index 00000000..14f2e335 --- /dev/null +++ b/test/long-lines-negative-line-length.md @@ -0,0 +1,12 @@ +# Long Lines Negative Line Length + +Text text text text text text text text text text text text text text text text text text text text. + +This is an invalid configuration, but present in the wild and (for backward compatibility) disables the rule: + + + diff --git a/test/long-lines-thresholds.md b/test/long-lines-thresholds.md new file mode 100644 index 00000000..256e017f --- /dev/null +++ b/test/long-lines-thresholds.md @@ -0,0 +1,37 @@ +# Long Lines Thresholds + +00000000011111111112222222222333333333344444444445 +12345678901234567890123456789012345678901234567890 + +Texxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx t + +Texxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx t + +{MD013:-2} + +## Texxxxxxxxxxxxxxxxxxxxxxxx t + +## Texxxxxxxxxxxxxxxxxxxxxxxxx t + +{MD013:-2} + +```text +Texxxxxxxxxxxxxxxxx t +Texxxxxxxxxxxxxxxxxx t +``` + +{MD013:-3} + + Texxxxxxxxxxxxx t + Texxxxxxxxxxxxxx t + +{MD013:-2} + + diff --git a/test/markdownlint-test.mjs b/test/markdownlint-test.mjs index d8b73509..c4c74236 100644 --- a/test/markdownlint-test.mjs +++ b/test/markdownlint-test.mjs @@ -1101,7 +1101,7 @@ test("readme", async(t) => { }); test("validateJsonUsingConfigSchemaStrict", async(t) => { - t.plan(220); + t.plan(221); // @ts-ignore const ajv = new Ajv(ajvOptions); const validateSchemaStrict = ajv.compile(configSchemaStrict); @@ -1112,6 +1112,7 @@ test("validateJsonUsingConfigSchemaStrict", async(t) => { "test/inline-configure-file-invalid.md", "test/inline-configure-file-violations.md", "test/invalid-ul-style-style.md", + "test/long-lines-negative-line-length.md", "test/wrong-types-in-config-file.md" ]); const files = await globby([ diff --git a/test/snapshots/markdownlint-test-scenarios.mjs.md b/test/snapshots/markdownlint-test-scenarios.mjs.md index 454a836b..400f3864 100644 --- a/test/snapshots/markdownlint-test-scenarios.mjs.md +++ b/test/snapshots/markdownlint-test-scenarios.mjs.md @@ -42078,6 +42078,27 @@ Generated by [AVA](https://avajs.dev). `, } +## long-lines-negative-line-length.md + +> Snapshot 1 + + { + errors: [], + fixed: `# Long Lines Negative Line Length␊ + ␊ + Text text text text text text text text text text text text text text text text text text text text.␊ + ␊ + This is an invalid configuration, but present in the wild and (for backward compatibility) disables the rule:␊ + ␊ + ␊ + ␊ + `, + } + ## long-lines-short-code.md > Snapshot 1 @@ -42637,6 +42658,121 @@ Generated by [AVA](https://avajs.dev). `, } +## long-lines-thresholds.md + +> Snapshot 1 + + { + errors: [ + { + errorContext: null, + errorDetail: 'Expected: 40; Actual: 42', + errorRange: [ + 41, + 2, + ], + fixInfo: null, + lineNumber: 8, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 30; Actual: 32', + errorRange: [ + 31, + 2, + ], + fixInfo: null, + lineNumber: 14, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 20; Actual: 22', + errorRange: [ + 21, + 2, + ], + fixInfo: null, + lineNumber: 20, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + { + errorContext: null, + errorDetail: 'Expected: 20; Actual: 22', + errorRange: [ + 21, + 2, + ], + fixInfo: null, + lineNumber: 26, + ruleDescription: 'Line length', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md013.md', + ruleNames: [ + 'MD013', + 'line-length', + ], + severity: 'error', + }, + ], + fixed: `# Long Lines Thresholds␊ + ␊ + 00000000011111111112222222222333333333344444444445␊ + 12345678901234567890123456789012345678901234567890␊ + ␊ + Texxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx t␊ + ␊ + Texxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx t␊ + ␊ + {MD013:-2}␊ + ␊ + ## Texxxxxxxxxxxxxxxxxxxxxxxx t␊ + ␊ + ## Texxxxxxxxxxxxxxxxxxxxxxxxx t␊ + ␊ + {MD013:-2}␊ + ␊ + \`\`\`text␊ + Texxxxxxxxxxxxxxxxx t␊ + Texxxxxxxxxxxxxxxxxx t␊ + \`\`\`␊ + ␊ + {MD013:-3}␊ + ␊ + Texxxxxxxxxxxxx t␊ + Texxxxxxxxxxxxxx t␊ + ␊ + {MD013:-2}␊ + ␊ + ␊ + `, + } + ## long_lines.md > Snapshot 1 diff --git a/test/snapshots/markdownlint-test-scenarios.mjs.snap b/test/snapshots/markdownlint-test-scenarios.mjs.snap index f1350fa3..dbe674f4 100644 Binary files a/test/snapshots/markdownlint-test-scenarios.mjs.snap and b/test/snapshots/markdownlint-test-scenarios.mjs.snap differ