Skip to content

Commit

Permalink
Add tests for the indented syntax (#2034)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesnw authored Nov 4, 2024
1 parent eabbabc commit 106cd32
Show file tree
Hide file tree
Showing 11 changed files with 963 additions and 119 deletions.
54 changes: 54 additions & 0 deletions spec/arguments/invocation.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,57 @@ Error: Positional arguments must come before keyword arguments.
| ^
'
input.scss 3:14 root stylesheet

<===>
================================================================================
<===> function/error/sass/multi-line-arguments/declaration/input.sass
@function a(
$b,
$c
)
@return d

e
f: a(g, h)

<===> function/error/sass/multi-line-arguments/declaration/error
Error: expected ")".
,
1 | @function a(
| ^
'
input.sass 1:13 root stylesheet

<===>
================================================================================
<===> function/error/sass/multi-line-arguments/invocation/input.sass
@function a($b, $c)
@return d

e
f: a(
g,
h
)

<===> function/error/sass/multi-line-arguments/invocation/error
Error: expected ")".
,
5 | f: a(
| ^
'
input.sass 5:8 root stylesheet

<===>
================================================================================
<===> function/arguments/sass/input.sass
@function a($b, $c)
@return d

e
f: a(g, h)

<===> function/arguments/sass/output.css
e {
f: d;
}
109 changes: 97 additions & 12 deletions spec/css/custom_properties/trailing_whitespace.hrx
Original file line number Diff line number Diff line change
@@ -1,16 +1,101 @@
<===> input.scss
.trailing-whitespace {
--space: value ;
--tab: value ;
--newline: value
<===> scss/space/input.scss
a {
--b: c ;
}

<===> scss/space/output.css
a {
--b: c ;
}

<===>
================================================================================
<===> scss/tab/input.scss
a {
--b: c ;
}

<===> scss/tab/output.css
a {
--b: c ;
}

<===>
================================================================================
<===> scss/newline/input.scss
a {
--b: c
;
--before-closing-brace: value
}

<===> output.css
.trailing-whitespace {
--space: value ;
--tab: value ;
--newline: value ;
--before-closing-brace: value ;
<===> scss/newline/output.css
a {
--b: c ;
}

<===>
================================================================================
<===> scss/before-closing-brace/input.scss
a {
--b: c
}

<===> scss/before-closing-brace/output.css
a {
--b: c ;
}

<===>
================================================================================
<===> sass/space/input.sass
a
--b: c

<===> sass/space/output.css
a {
--b: c;
}

<===>
================================================================================
<===> sass/tab/input.sass
a
--b: c

<===> sass/tab/output.css
a {
--b: c;
}

<===>
================================================================================
<===> sass/newline/input.sass
a
--b: c

--d: e


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

<===>
================================================================================
<===> sass/before-block-end/input.sass
a
--b: c

d
--e: f

<===> sass/before-block-end/output.css
a {
--b: c;
}

d {
--e: f;
}
150 changes: 148 additions & 2 deletions spec/css/custom_properties/value_interpolation.hrx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<===> input.scss
<===> scss/value-interpolation/input.scss
.value-interpolation {
// Interpolation is the only Sass construct that's supported in custom
// variables.
Expand All @@ -9,11 +9,157 @@
--in-uri: uri(foo#{1 + 2}bar);
}

<===> output.css
<===> scss/value-interpolation/output.css
.value-interpolation {
--alone: 3;
--in-list: a 3 c;
--in-ident: foo3bar;
--in-string: "foo3bar";
--in-uri: uri(foo3bar);
}

<===>
================================================================================
<===> scss/alone/input.scss
a{
--b: #{1 + 2};
}

<===> scss/alone/output.css
a {
--b: 3;
}

<===>
================================================================================
<===> scss/in-list/input.scss
a{
--b: c #{1 + 2} d;
}

<===> scss/in-list/output.css
a {
--b: c 3 d;
}

<===>
================================================================================
<===> scss/in-string/input.scss
a{
--b: "c#{1 + 2}d";
}

<===> scss/in-string/output.css
a {
--b: "c3d";
}

<===>
================================================================================
<===> scss/in-ident/input.scss
a{
--b: c#{1 + 2}d;
}

<===> scss/in-ident/output.css
a {
--b: c3d;
}

<===>
================================================================================
<===> scss/in-uri/input.scss
a{
--b: uri(c#{1 + 2}d);
}

<===> scss/in-uri/output.css
a {
--b: uri(c3d);
}

<===>
================================================================================
<===> scss/linebreak-interpolation/input.scss
a{
--b: #{1
+
2};
}

<===> scss/linebreak-interpolation/output.css
a {
--b: 3;
}

<===>
================================================================================
<===> sass/alone/input.sass
a
--b: #{1 + 2}

<===> sass/alone/output.css
a {
--b: 3;
}

<===>
================================================================================
<===> sass/in-list/input.sass
a
--b: c #{1 + 2} d

<===> sass/in-list/output.css
a {
--b: c 3 d;
}

<===>
================================================================================
<===> sass/in-string/input.sass
a
--b: "c#{1 + 2}d"

<===> sass/in-string/output.css
a {
--b: "c3d";
}

<===>
================================================================================
<===> sass/in-ident/input.sass
a
--b: c#{1 + 2}d

<===> sass/in-ident/output.css
a {
--b: c3d;
}

<===>
================================================================================
<===> sass/in-uri/input.sass
a
--b: uri(c#{1 + 2}d)

<===> sass/in-uri/output.css
a {
--b: uri(c3d);
}

<===>
================================================================================
<===> error/sass/linebreak-interpolation/input.sass
a
--b: #{1
+
2}


<===> error/sass/linebreak-interpolation/error
Error: expected "}".
,
2 | --b: #{1
| ^
'
input.sass 2:12 root stylesheet
Loading

0 comments on commit 106cd32

Please sign in to comment.