Skip to content

Commit

Permalink
add tests of edge cases round liquid
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyab committed Feb 16, 2024
1 parent 4aebc0e commit b3f24e2
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 0 deletions.
168 changes: 168 additions & 0 deletions tests/format/markdown/liquid/__snapshots__/jsfmt.spec.js.snap
Expand Up @@ -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_
================================================================================
`;
2 changes: 2 additions & 0 deletions 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* }}
3 changes: 3 additions & 0 deletions 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* }}
3 changes: 3 additions & 0 deletions 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*
@@ -0,0 +1,3 @@


Following brace doesn't open so these words should not be considered as *liquid node* %}
3 changes: 3 additions & 0 deletions 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*

0 comments on commit b3f24e2

Please sign in to comment.