From b3f24e2dd6779c870142b2873ccd1990b7546037 Mon Sep 17 00:00:00 2001 From: seiya <20365512+seiyab@users.noreply.github.com> Date: Fri, 16 Feb 2024 12:00:07 +0900 Subject: [PATCH] add tests of edge cases round liquid Related: #11828 --- .../liquid/__snapshots__/jsfmt.spec.js.snap | 168 ++++++++++++++++++ .../liquid/unbalanced-mismatched-braces.md | 2 + .../liquid/unbalanced-object-close-only.md | 3 + .../liquid/unbalanced-object-open-only.md | 3 + .../liquid/unbalanced-template-close-only.md | 3 + .../liquid/unbalanced-template-open-only.md | 3 + 6 files changed, 182 insertions(+) create mode 100644 tests/format/markdown/liquid/unbalanced-mismatched-braces.md create mode 100644 tests/format/markdown/liquid/unbalanced-object-close-only.md create mode 100644 tests/format/markdown/liquid/unbalanced-object-open-only.md create mode 100644 tests/format/markdown/liquid/unbalanced-template-close-only.md create mode 100644 tests/format/markdown/liquid/unbalanced-template-open-only.md diff --git a/tests/format/markdown/liquid/__snapshots__/jsfmt.spec.js.snap b/tests/format/markdown/liquid/__snapshots__/jsfmt.spec.js.snap index 5f0c73fba18e..b14887680ec4 100644 --- a/tests/format/markdown/liquid/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/markdown/liquid/__snapshots__/jsfmt.spec.js.snap @@ -71,3 +71,171 @@ where does it end }} ================================================================================ `; + +exports[`unbalanced-mismatched-braces.md - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + +Braces {% doesn't match so these words should not be considered as *liquid node* }} + +=====================================output===================================== +Braces {% doesn't match so these words should not be considered as _liquid node_ +}} + +================================================================================ +`; + +exports[`unbalanced-mismatched-braces.md format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 + | printWidth +=====================================input====================================== + +Braces {% doesn't match so these words should not be considered as *liquid node* }} + +=====================================output===================================== +Braces {% doesn't match so these words should not be considered as _liquid node_ }} + +================================================================================ +`; + +exports[`unbalanced-object-close-only.md - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +Following brace doesn't open so these words should not be considered as *liquid node* }} + +=====================================output===================================== +Following brace doesn't open so these words should not be considered as _liquid +node_ }} + +================================================================================ +`; + +exports[`unbalanced-object-close-only.md format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +Following brace doesn't open so these words should not be considered as *liquid node* }} + +=====================================output===================================== +Following brace doesn't open so these words should not be considered as _liquid node_ }} + +================================================================================ +`; + +exports[`unbalanced-object-open-only.md - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +This brace {{ doesn't close so these words should not be considered as *liquid node* + +=====================================output===================================== +This brace {{ doesn't close so these words should not be considered as _liquid +node_ + +================================================================================ +`; + +exports[`unbalanced-object-open-only.md format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +This brace {{ doesn't close so these words should not be considered as *liquid node* + +=====================================output===================================== +This brace {{ doesn't close so these words should not be considered as _liquid node_ + +================================================================================ +`; + +exports[`unbalanced-template-close-only.md - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +Following brace doesn't open so these words should not be considered as *liquid node* %} + +=====================================output===================================== +Following brace doesn't open so these words should not be considered as _liquid +node_ %} + +================================================================================ +`; + +exports[`unbalanced-template-close-only.md format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +Following brace doesn't open so these words should not be considered as *liquid node* %} + +=====================================output===================================== +Following brace doesn't open so these words should not be considered as _liquid node_ %} + +================================================================================ +`; + +exports[`unbalanced-template-open-only.md - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +This brace {% doesn't close so these words should not be considered as *liquid node* + +=====================================output===================================== +This brace {% doesn't close so these words should not be considered as _liquid +node_ + +================================================================================ +`; + +exports[`unbalanced-template-open-only.md format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +This brace {% doesn't close so these words should not be considered as *liquid node* + +=====================================output===================================== +This brace {% doesn't close so these words should not be considered as _liquid node_ + +================================================================================ +`; diff --git a/tests/format/markdown/liquid/unbalanced-mismatched-braces.md b/tests/format/markdown/liquid/unbalanced-mismatched-braces.md new file mode 100644 index 000000000000..ba708f248c1a --- /dev/null +++ b/tests/format/markdown/liquid/unbalanced-mismatched-braces.md @@ -0,0 +1,2 @@ + +Braces {% doesn't match so these words should not be considered as *liquid node* }} diff --git a/tests/format/markdown/liquid/unbalanced-object-close-only.md b/tests/format/markdown/liquid/unbalanced-object-close-only.md new file mode 100644 index 000000000000..ed72b4894889 --- /dev/null +++ b/tests/format/markdown/liquid/unbalanced-object-close-only.md @@ -0,0 +1,3 @@ + + +Following brace doesn't open so these words should not be considered as *liquid node* }} diff --git a/tests/format/markdown/liquid/unbalanced-object-open-only.md b/tests/format/markdown/liquid/unbalanced-object-open-only.md new file mode 100644 index 000000000000..d59a7abae9e8 --- /dev/null +++ b/tests/format/markdown/liquid/unbalanced-object-open-only.md @@ -0,0 +1,3 @@ + + +This brace {{ doesn't close so these words should not be considered as *liquid node* diff --git a/tests/format/markdown/liquid/unbalanced-template-close-only.md b/tests/format/markdown/liquid/unbalanced-template-close-only.md new file mode 100644 index 000000000000..ecf41a5db151 --- /dev/null +++ b/tests/format/markdown/liquid/unbalanced-template-close-only.md @@ -0,0 +1,3 @@ + + +Following brace doesn't open so these words should not be considered as *liquid node* %} diff --git a/tests/format/markdown/liquid/unbalanced-template-open-only.md b/tests/format/markdown/liquid/unbalanced-template-open-only.md new file mode 100644 index 000000000000..f49bcc5e1250 --- /dev/null +++ b/tests/format/markdown/liquid/unbalanced-template-open-only.md @@ -0,0 +1,3 @@ + + +This brace {% doesn't close so these words should not be considered as *liquid node*