Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for comments around statements #1998

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions spec/css/media/comment.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<===> before_query/loud/input.scss
@media /**/ screen {}

<===> before_query/loud/output.css

<===>
================================================================================
<===> before_query/silent/input.scss
@media //
screen {}

<===> before_query/silent/output.css

<===>
================================================================================
<===> after_query/loud/input.scss
@media screen /**/ {}

<===> after_query/loud/output.css

<===>
================================================================================
<===> after_query/silent/input.scss
@media screen //
{}

<===> after_query/silent/output.css
71 changes: 71 additions & 0 deletions spec/css/moz_document/comment.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<===> before_arg/loud/input.scss
@-moz-document /**/ url-prefix(a) {}

<===> before_arg/loud/output.css
@-moz-document url-prefix(a) {}

<===> before_arg/loud/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
@-moz-document is deprecated and support will be removed in Dart Sass 2.0.0.

For details, see https://sass-lang.com/d/moz-document.
,
1 | @-moz-document /**/ url-prefix(a) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> before_arg/silent/input.scss
@-moz-document //
url-prefix(a) {}

<===> before_arg/silent/output.css
@-moz-document url-prefix(a) {}

<===> before_arg/silent/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
@-moz-document is deprecated and support will be removed in Dart Sass 2.0.0.

For details, see https://sass-lang.com/d/moz-document.
,
1 | / @-moz-document //
2 | \ url-prefix(a) {}
'

<===>
================================================================================
<===> after_arg/loud/input.scss
@-moz-document url-prefix(a) /**/ {}

<===> after_arg/loud/output.css
@-moz-document url-prefix(a) {}

<===> after_arg/loud/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
@-moz-document is deprecated and support will be removed in Dart Sass 2.0.0.

For details, see https://sass-lang.com/d/moz-document.
,
1 | @-moz-document url-prefix(a) /**/ {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> after_arg/silent/input.scss
@-moz-document url-prefix(a) //
{}

<===> after_arg/silent/output.css
@-moz-document url-prefix(a) {}

<===> after_arg/silent/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
@-moz-document is deprecated and support will be removed in Dart Sass 2.0.0.

For details, see https://sass-lang.com/d/moz-document.
,
1 | / @-moz-document url-prefix(a) //
2 | \ {}
'
45 changes: 45 additions & 0 deletions spec/css/propset.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,51 @@ a {
b-c: --d;
}

<===>
================================================================================
<===> comment/before_block/loud/input.scss
a {b: /**/ {c: d}}

<===> comment/before_block/loud/output.css
a {
b-c: d;
}

<===>
================================================================================
<===> comment/before_block/silent/input.scss
a {
b: //
{c: d}
}

<===> comment/before_block/silent/output.css
a {
b-c: d;
}

<===>
================================================================================
<===> comment/after_block/loud/input.scss
a {b: {c: d} /**/}

<===> comment/after_block/loud/output.css
a {
b-c: d; /**/
}

<===>
================================================================================
<===> comment/after_block/silent/input.scss
a {
b: {c: d} //
}

<===> comment/after_block/silent/output.css
a {
b-c: d;
}

<===>
================================================================================
<===> error/value_after_propset/input.scss
Expand Down
75 changes: 75 additions & 0 deletions spec/css/style_rule.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<===> comment/after_selector/loud/input.scss
a /**/ {}

<===> comment/after_selector/loud/output.css

<===>
================================================================================
<===> comment/after_selector/silent/input.scss
a //
{}

<===> comment/after_selector/silent/output.css

<===>
================================================================================
<===> declaration/comment/before_colon/loud/input.scss
a {b /**/ : c}

<===> declaration/comment/before_colon/loud/output.css
a {
b: c;
}

<===>
================================================================================
<===> declaration/comment/before_colon/silent/input.scss
a {b //
: c}

<===> declaration/comment/before_colon/silent/output.css
a {
b: c;
}

<===>
================================================================================
<===> declaration/comment/after_colon/loud/input.scss
a {b: /**/ c}

<===> declaration/comment/after_colon/loud/output.css
a {
b: c;
}

<===>
================================================================================
<===> declaration/comment/after_colon/silent/input.scss
a {b: //
c}

<===> declaration/comment/after_colon/silent/output.css
a {
b: c;
}

<===>
================================================================================
<===> declaration/comment/after_value/loud/input.scss
a {b: c /**/}

<===> declaration/comment/after_value/loud/output.css
a {
b: c;
}

<===>
================================================================================
<===> declaration/comment/after_value/silent/input.scss
a {b: c //
}

<===> declaration/comment/after_value/silent/output.css
a {
b: c;
}
27 changes: 27 additions & 0 deletions spec/css/supports/comment.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<===> before_query/loud/input.scss
@supports /**/ (a: b) {}

<===> before_query/loud/output.css

<===>
================================================================================
<===> before_query/silent/input.scss
@supports //
(a: b) {}

<===> before_query/silent/output.css

<===>
================================================================================
<===> after_query/loud/input.scss
@supports (a: b) /**/ {}

<===> after_query/loud/output.css

<===>
================================================================================
<===> after_query/silent/input.scss
@supports (a: b) //
{}

<===> after_query/silent/output.css
113 changes: 113 additions & 0 deletions spec/css/unknown_directive/comment.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<===> no_children/before_value/loud/input.scss
@a /**/ b

<===> no_children/before_value/loud/output.css
@a b;

<===>
================================================================================
<===> no_children/before_value/silent/input.scss
@a //
b

<===> no_children/before_value/silent/output.css
@a b;

<===>
================================================================================
<===> no_children/after_value/loud/options.yml
:todo:
- sass/dart-sass#2263

<===> no_children/after_value/loud/input.scss
@a b /**/

<===> no_children/after_value/loud/output.css
@a b;

<===>
================================================================================
<===> no_children/after_value/silent/options.yml
:todo:
- sass/dart-sass#2263

<===> no_children/after_value/silent/input.scss
@a b //

<===> no_children/after_value/silent/output.css
@a b;

<===>
================================================================================
<===> no_children/no_value/loud/input.scss
@a /**/

<===> no_children/no_value/loud/output.css
@a;

<===>
================================================================================
<===> no_children/no_value/silent/input.scss
@a //

<===> no_children/no_value/silent/output.css
@a;

<===>
================================================================================
<===> children/before_value/loud/input.scss
@a /**/ b {}

<===> children/before_value/loud/output.css
@a b {}

<===>
================================================================================
<===> children/before_value/silent/input.scss
@a //
b {}

<===> children/before_value/silent/output.css
@a b {}

<===>
================================================================================
<===> children/after_value/loud/options.yml
:todo:
- sass/dart-sass#2263

<===> children/after_value/loud/input.scss
@a b /**/ {}

<===> children/after_value/loud/output.css
@a b {};

<===>
================================================================================
<===> children/after_value/silent/options.yml
:todo:
- sass/dart-sass#2263

<===> children/after_value/silent/input.scss
@a b //
{}

<===> children/after_value/silent/output.css
@a b {};

<===>
================================================================================
<===> children/no_value/loud/input.scss
@a /**/ {}

<===> children/no_value/loud/output.css
@a {}

<===>
================================================================================
<===> children/no_value/silent/input.scss
@a //
{}

<===> children/no_value/silent/output.css
@a {}
Loading
Loading