From 272bea50b62026ecade64cb5e281700bf486269a Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Wed, 29 Jul 2020 00:30:42 +0900 Subject: [PATCH] Add tests for #3223 (#8849) --- .../list/__snapshots__/jsfmt.spec.js.snap | 175 ++++++++++++++++++ tests/markdown/list/nested-tab.md | 15 ++ 2 files changed, 190 insertions(+) create mode 100644 tests/markdown/list/nested-tab.md diff --git a/tests/markdown/list/__snapshots__/jsfmt.spec.js.snap b/tests/markdown/list/__snapshots__/jsfmt.spec.js.snap index b24171010..6a635af8c 100644 --- a/tests/markdown/list/__snapshots__/jsfmt.spec.js.snap +++ b/tests/markdown/list/__snapshots__/jsfmt.spec.js.snap @@ -2783,6 +2783,181 @@ proseWrap: "always" ================================================================================ `; +exports[`nested-tab.md - {"proseWrap":"always","tabWidth":0} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" +tabWidth: 0 + | printWidth +=====================================input====================================== +# List with 1 tab indentation and \`-\` +- Top level list item 1 +- Top level list item 2 + - Nested List item 1 + - Nested List item 2 + - Sub-Nested List item 1 + - Sub-Nested List item 2 + +# List with 1 tab indentation and \`*\` +* Top level list item 1 +* Top level list item 2 + * Nested List item 1 + * Nested List item 2 + * Sub-Nested List item 1 + * Sub-Nested List item 2 + +=====================================output===================================== +# List with 1 tab indentation and \`-\` + +- Top level list item 1 +- Top level list item 2 + - Nested List item 1 + - Nested List item 2 + - Sub-Nested List item 1 + - Sub-Nested List item 2 + +# List with 1 tab indentation and \`*\` + +- Top level list item 1 +- Top level list item 2 + - Nested List item 1 + - Nested List item 2 _ Sub-Nested List item 1 _ Sub-Nested List item 2 + +================================================================================ +`; + +exports[`nested-tab.md - {"proseWrap":"always","tabWidth":4} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" +tabWidth: 4 + | printWidth +=====================================input====================================== +# List with 1 tab indentation and \`-\` +- Top level list item 1 +- Top level list item 2 + - Nested List item 1 + - Nested List item 2 + - Sub-Nested List item 1 + - Sub-Nested List item 2 + +# List with 1 tab indentation and \`*\` +* Top level list item 1 +* Top level list item 2 + * Nested List item 1 + * Nested List item 2 + * Sub-Nested List item 1 + * Sub-Nested List item 2 + +=====================================output===================================== +# List with 1 tab indentation and \`-\` + +- Top level list item 1 +- Top level list item 2 + - Nested List item 1 + - Nested List item 2 + - Sub-Nested List item 1 + - Sub-Nested List item 2 + +# List with 1 tab indentation and \`*\` + +- Top level list item 1 +- Top level list item 2 + - Nested List item 1 + - Nested List item 2 _ Sub-Nested List item 1 _ Sub-Nested List item 2 + +================================================================================ +`; + +exports[`nested-tab.md - {"proseWrap":"always","tabWidth":999} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" +tabWidth: 999 + | printWidth +=====================================input====================================== +# List with 1 tab indentation and \`-\` +- Top level list item 1 +- Top level list item 2 + - Nested List item 1 + - Nested List item 2 + - Sub-Nested List item 1 + - Sub-Nested List item 2 + +# List with 1 tab indentation and \`*\` +* Top level list item 1 +* Top level list item 2 + * Nested List item 1 + * Nested List item 2 + * Sub-Nested List item 1 + * Sub-Nested List item 2 + +=====================================output===================================== +# List with 1 tab indentation and \`-\` + +- Top level list item 1 +- Top level list item 2 + - Nested List item 1 + - Nested List item 2 + - Sub-Nested List item 1 + - Sub-Nested List item 2 + +# List with 1 tab indentation and \`*\` + +- Top level list item 1 +- Top level list item 2 + - Nested List item 1 + - Nested List item 2 _ Sub-Nested List item 1 _ Sub-Nested List item 2 + +================================================================================ +`; + +exports[`nested-tab.md - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +# List with 1 tab indentation and \`-\` +- Top level list item 1 +- Top level list item 2 + - Nested List item 1 + - Nested List item 2 + - Sub-Nested List item 1 + - Sub-Nested List item 2 + +# List with 1 tab indentation and \`*\` +* Top level list item 1 +* Top level list item 2 + * Nested List item 1 + * Nested List item 2 + * Sub-Nested List item 1 + * Sub-Nested List item 2 + +=====================================output===================================== +# List with 1 tab indentation and \`-\` + +- Top level list item 1 +- Top level list item 2 + - Nested List item 1 + - Nested List item 2 + - Sub-Nested List item 1 + - Sub-Nested List item 2 + +# List with 1 tab indentation and \`*\` + +- Top level list item 1 +- Top level list item 2 + - Nested List item 1 + - Nested List item 2 _ Sub-Nested List item 1 _ Sub-Nested List item 2 + +================================================================================ +`; + exports[`ordered.md - {"proseWrap":"always","tabWidth":0} format 1`] = ` ====================================options===================================== parsers: ["markdown"] diff --git a/tests/markdown/list/nested-tab.md b/tests/markdown/list/nested-tab.md new file mode 100644 index 000000000..13fe02602 --- /dev/null +++ b/tests/markdown/list/nested-tab.md @@ -0,0 +1,15 @@ +# List with 1 tab indentation and `-` +- Top level list item 1 +- Top level list item 2 + - Nested List item 1 + - Nested List item 2 + - Sub-Nested List item 1 + - Sub-Nested List item 2 + +# List with 1 tab indentation and `*` +* Top level list item 1 +* Top level list item 2 + * Nested List item 1 + * Nested List item 2 + * Sub-Nested List item 1 + * Sub-Nested List item 2