Skip to content

Commit

Permalink
Test whitespace in functions and parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesnw committed Jan 28, 2025
1 parent 00f65b5 commit 2719995
Show file tree
Hide file tree
Showing 5 changed files with 315 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/callable/whitespace.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@

<===> newlines/function/after_colon/sass/output.css

<===>
================================================================================
<===> newlines/function/space_after_colon/sass/input.sass
@function a($b, $c: d
e)

<===> newlines/function/space_after_colon/sass/output.css

<===>
================================================================================
<===> newlines/function/before_paren/scss/input.scss
Expand Down Expand Up @@ -234,6 +242,16 @@ $e: a(f, $c:

<===> newlines/function_invocation/after_colon/sass/output.css

<===>
================================================================================
<===> newlines/function_invocation/space_after_colon/sass/input.sass
@function a($b, $c:d)
@return null
$e: a(f, $c: g
h)

<===> newlines/function_invocation/space_after_colon/sass/output.css

<===>
================================================================================
<===> newlines/function_invocation/before_paren/scss/input.scss
Expand Down
122 changes: 122 additions & 0 deletions spec/core_functions/global/newlines.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<===> after_paren/input.sass
a
b: append(
c d, e)

<===> after_paren/output.css
a {
b: c d e;
}

<===> after_paren/warning
DEPRECATION WARNING [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
Use list.append instead.

More info and automated migrator: https://sass-lang.com/d/import

,
2 | b: append(
| ,------^
3 | \ c d, e)
'
input.sass 2:6 root stylesheet

<===>
================================================================================
<===> after_value/input.sass
a
b: append(c
d, e)

<===> after_value/output.css
a {
b: c d e;
}

<===> after_value/warning
DEPRECATION WARNING [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
Use list.append instead.

More info and automated migrator: https://sass-lang.com/d/import

,
2 | b: append(c
| ,------^
3 | \ d, e)
'
input.sass 2:6 root stylesheet

<===>
================================================================================
<===> before_comma/input.sass
a
b: append(c d
, e)

<===> before_comma/output.css
a {
b: c d e;
}

<===> before_comma/warning
DEPRECATION WARNING [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
Use list.append instead.

More info and automated migrator: https://sass-lang.com/d/import

,
2 | b: append(c d
| ,------^
3 | \ , e)
'
input.sass 2:6 root stylesheet

<===>
================================================================================
<===> after_comma/input.sass
a
b: append(c d,
e)

<===> after_comma/output.css
a {
b: c d e;
}

<===> after_comma/warning
DEPRECATION WARNING [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
Use list.append instead.

More info and automated migrator: https://sass-lang.com/d/import

,
2 | b: append(c d,
| ,------^
3 | \ e)
'
input.sass 2:6 root stylesheet

<===>
================================================================================
<===> before_paren/input.sass
a
b: append(c d, e
)

<===> before_paren/output.css
a {
b: c d e;
}

<===> before_paren/warning
DEPRECATION WARNING [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
Use list.append instead.

More info and automated migrator: https://sass-lang.com/d/import

,
2 | b: append(c d, e
| ,------^
3 | \ )
'
input.sass 2:6 root stylesheet
62 changes: 62 additions & 0 deletions spec/core_functions/newlines.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<===> after_paren/input.sass
@use "sass:list";
a
b: list.append(
c d, e)

<===> after_paren/output.css
a {
b: c d e;
}

<===>
================================================================================
<===> after_value/input.sass
@use "sass:list";
a
b: list.append(c
d, e)

<===> after_value/output.css
a {
b: c d e;
}

<===>
================================================================================
<===> before_comma/input.sass
@use "sass:list";
a
b: list.append(c d
, e)

<===> before_comma/output.css
a {
b: c d e;
}

<===>
================================================================================
<===> after_comma/input.sass
@use "sass:list";
a
b: list.append(c d,
e)

<===> after_comma/output.css
a {
b: c d e;
}

<===>
================================================================================
<===> before_paren/input.sass
@use "sass:list";
a
b: list.append(c d, e
)

<===> before_paren/output.css
a {
b: c d e;
}
105 changes: 105 additions & 0 deletions spec/css/functions/newlines.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<===> value/before/input.sass
a
b: c(
d)

<===> value/before/output.css
a {
b: c(d);
}

<===>
================================================================================
<===> value/after/input.sass
a
b: c(d
)

<===> value/after/output.css
a {
b: c(d);
}

<===>
================================================================================
<===> value/between/input.sass
a
b: c(d
e)

<===> value/between/output.css
a {
b: c(d e);
}

<===>
================================================================================
<===> comma/before/input.sass
a
b: c(d
,e)

<===> comma/before/output.css
a {
b: c(d, e);
}

<===>
================================================================================
<===> comma/after/input.sass
a
b: c(d,
e)

<===> comma/after/output.css
a {
b: c(d, e);
}

<===>
================================================================================
<===> trailing_comma/before/input.sass
a
b: c(d
,)

<===> trailing_comma/before/output.css
a {
b: c(d);
}

<===>
================================================================================
<===> trailing_comma/after/input.sass
a
b: c(d,
)

<===> trailing_comma/after/output.css
a {
b: c(d);
}

<===>
================================================================================
<===> slash/before/input.sass
a
b: c(d
/ e)

<===> slash/before/output.css
a {
b: c(d/e);
}

<===>
================================================================================
<===> slash/after/input.sass
a
b: c(d /
e)

<===> slash/after/output.css
a {
b: c(d/e);
}
8 changes: 8 additions & 0 deletions spec/values/maps/sass.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ $a: (b: c

<===> whitespace/after_first_value/output.css

<===>
================================================================================
<===> whitespace/between_values/input.sass
$a: (b: c
d, d: e)

<===> whitespace/between_values/output.css

<===>
================================================================================
<===> whitespace/after_comma/input.sass
Expand Down

0 comments on commit 2719995

Please sign in to comment.