From 190d34fa4641f55023b0c201fa9018c49c687257 Mon Sep 17 00:00:00 2001 From: Evilebot Tnawi Date: Wed, 21 Mar 2018 12:04:57 +0300 Subject: [PATCH] tests: comments with `CRLF` (#4145) --- tests/css_comments/CRLF.css | 19 ++ tests/css_comments/CRLF.less | 25 +++ tests/css_comments/CRLF.scss | 40 ++++ .../__snapshots__/jsfmt.spec.js.snap | 183 ++++++++++++++++++ 4 files changed, 267 insertions(+) create mode 100644 tests/css_comments/CRLF.css create mode 100644 tests/css_comments/CRLF.less create mode 100644 tests/css_comments/CRLF.scss diff --git a/tests/css_comments/CRLF.css b/tests/css_comments/CRLF.css new file mode 100644 index 00000000..2a15b032 --- /dev/null +++ b/tests/css_comments/CRLF.css @@ -0,0 +1,19 @@ +/* + * Comment 1 + */ +#header { + /* + * Comment 2 + */ + color: red; +} + +@media only screen and (max-width: 600px) { + /* + * Comment 3 + */ + body { + background-color: lightblue; /* Comment 4 */ + color: red; /* Comment 5 */ + } +} diff --git a/tests/css_comments/CRLF.less b/tests/css_comments/CRLF.less new file mode 100644 index 00000000..95a8513a --- /dev/null +++ b/tests/css_comments/CRLF.less @@ -0,0 +1,25 @@ +@nice-blue: #5B83AD; +@light-blue: @nice-blue + #111; + +// Comment 1 +/* + * Comment 2 + */ +#header { + // Comment 3 + /* + * Comment 4 + */ + color: @light-blue; +} + +@media only screen and (max-width: 600px) { + // Comment 1 + /* + * Comment 5 + */ + body { + background-color: lightblue; // Comment 6 + color: red; /* Comment 7 */ + } +} diff --git a/tests/css_comments/CRLF.scss b/tests/css_comments/CRLF.scss new file mode 100644 index 00000000..282b582e --- /dev/null +++ b/tests/css_comments/CRLF.scss @@ -0,0 +1,40 @@ +$nice-blue: #5B83AD; +$light-blue: $nice-blue + #111; + +// Comment 1 +/* + * Comment 2 + */ +#header { + // Comment 3 + /* + * Comment 4 + */ + color: @light-blue; +} + +@media only screen and (max-width: 600px) { + // Comment 1 + /* + * Comment 5 + */ + body { + background-color: lightblue; // Comment 6 + color: red; /* Comment 7 */ + } +} + +@mixin create-rules($padding) { + // + // Comment 8 + // + .abc { + padding: $padding; + } + /** + * Comment 9 + */ + .def { + padding: $padding; + } +} diff --git a/tests/css_comments/__snapshots__/jsfmt.spec.js.snap b/tests/css_comments/__snapshots__/jsfmt.spec.js.snap index e23e2c2d..910369f9 100644 --- a/tests/css_comments/__snapshots__/jsfmt.spec.js.snap +++ b/tests/css_comments/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,188 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`CRLF.css 1`] = ` +/* + * Comment 1 + */ +#header { + /* + * Comment 2 + */ + color: red; +} + +@media only screen and (max-width: 600px) { + /* + * Comment 3 + */ + body { + background-color: lightblue; /* Comment 4 */ + color: red; /* Comment 5 */ + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* + * Comment 1 + */ +#header { + /* + * Comment 2 + */ + color: red; +} + +@media only screen and (max-width: 600px) { + /* + * Comment 3 + */ + body { + background-color: lightblue; /* Comment 4 */ + color: red; /* Comment 5 */ + } +} + +`; + +exports[`CRLF.less 1`] = ` +@nice-blue: #5B83AD; +@light-blue: @nice-blue + #111; + +// Comment 1 +/* + * Comment 2 + */ +#header { + // Comment 3 + /* + * Comment 4 + */ + color: @light-blue; +} + +@media only screen and (max-width: 600px) { + // Comment 1 + /* + * Comment 5 + */ + body { + background-color: lightblue; // Comment 6 + color: red; /* Comment 7 */ + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@nice-blue: #5B83AD; +@light-blue: @nice-blue + #111; + +// Comment 1 +/* + * Comment 2 + */ +#header { + // Comment 3 + /* + * Comment 4 + */ + color: @light-blue; +} + +@media only screen and (max-width: 600px) { + // Comment 1 + /* + * Comment 5 + */ + body { + background-color: lightblue; // Comment 6 + color: red; /* Comment 7 */ + } +} + +`; + +exports[`CRLF.scss 1`] = ` +$nice-blue: #5B83AD; +$light-blue: $nice-blue + #111; + +// Comment 1 +/* + * Comment 2 + */ +#header { + // Comment 3 + /* + * Comment 4 + */ + color: @light-blue; +} + +@media only screen and (max-width: 600px) { + // Comment 1 + /* + * Comment 5 + */ + body { + background-color: lightblue; // Comment 6 + color: red; /* Comment 7 */ + } +} + +@mixin create-rules($padding) { + // + // Comment 8 + // + .abc { + padding: $padding; + } + /** + * Comment 9 + */ + .def { + padding: $padding; + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +$nice-blue: #5b83ad; +$light-blue: $nice-blue + #111; + +// Comment 1 +/* + * Comment 2 + */ +#header { + // Comment 3 + /* + * Comment 4 + */ + color: @light-blue; +} + +@media only screen and (max-width: 600px) { + // Comment 1 + /* + * Comment 5 + */ + body { + background-color: lightblue; // Comment 6 + color: red; /* Comment 7 */ + } +} + +@mixin create-rules($padding) { + // + // Comment 8 + // + .abc { + padding: $padding; + } + /** + * Comment 9 + */ + .def { + padding: $padding; + } +} + +`; + exports[`at-rules.css 1`] = ` @charset "utf-8"; /* comment 1 */