Skip to content

Commit db3e244

Browse files
authored
Update tests for new selector span tracking (#1887)
See sass/dart-sass#1783
1 parent afccf34 commit db3e244

File tree

76 files changed

+180
-158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+180
-158
lines changed

js-api-spec/logger.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('deprecation warning', () => {
3030
expect(span?.start.line).toBe(0);
3131
expect(span?.start.column).toBe(0);
3232
expect(span?.end.line).toBe(0);
33-
expect(span?.end.column).toBe(4);
33+
expect(span?.end.column).toBe(3);
3434
done();
3535
},
3636
},

spec/core_functions/selector/append.hrx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,16 @@ Error: Can't append "> .d" to ".c" for `selector-append'
214214
a {b: selector-append(".c ~", ".d")}
215215

216216
<===> error/combinator/trailing/error
217-
Error: Parent ".c ~" is incompatible with this selector.
217+
Error: Selector ".c ~" can't be used as a parent in a compound selector.
218218
,
219+
1 | .c ~
220+
| ^^^^ outer selector
221+
'
222+
,--> input.scss
219223
1 | a {b: selector-append(".c ~", ".d")}
220-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
224+
| ============================= parent selector
221225
'
222-
input.scss 1:7 root stylesheet
226+
- 1:1 root stylesheet
223227

224228
<===> error/combinator/trailing/error-libsass
225229
Error: Invalid parent selector for "&.d": "&.c ~"

spec/css/plain/error/statement.hrx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ Error: Nested declarations aren't allowed in plain CSS.
362362
<===> style_rule/parent_selector/error
363363
Error: Parent selectors aren't allowed here.
364364
,
365-
1 | &.foo{
365+
1 | &.foo {
366366
| ^
367367
'
368368
plain.css 1:1 @import
@@ -380,7 +380,7 @@ Error: Parent selectors aren't allowed here.
380380
<===> style_rule/placeholder_selector/error
381381
Error: Placeholder selectors aren't allowed here.
382382
,
383-
1 | %foo{
383+
1 | %foo {
384384
| ^^^^
385385
'
386386
plain.css 1:1 @import

spec/css/selector/attribute.hrx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
<===> error/modifier/no_operator/error
9797
Error: Expected "]".
9898
,
99-
1 | [a b]{c: d}
99+
1 | [a b] {c: d}
100100
| ^
101101
'
102102
input.scss 1:4 root stylesheet
@@ -117,7 +117,7 @@ Error: invalid operator in attribute selector for a
117117
<===> error/modifier/too_long/error
118118
Error: expected "]".
119119
,
120-
2 | [a=b cd]{e: f}
120+
2 | [a=b cd] {e: f}
121121
| ^
122122
'
123123
input.scss 2:7 root stylesheet
@@ -138,7 +138,7 @@ Error: unterminated attribute selector for a
138138
<===> error/modifier/underscore/error
139139
Error: expected "]".
140140
,
141-
2 | [a=b _]{c: d}
141+
2 | [a=b _] {c: d}
142142
| ^
143143
'
144144
input.scss 2:6 root stylesheet
@@ -159,7 +159,7 @@ Error: unterminated attribute selector for a
159159
<===> error/modifier/digit/error
160160
Error: expected "]".
161161
,
162-
2 | [a=b 1]{c: d}
162+
2 | [a=b 1] {c: d}
163163
| ^
164164
'
165165
input.scss 2:6 root stylesheet
@@ -180,7 +180,7 @@ Error: unterminated attribute selector for a
180180
<===> error/modifier/unicode/error
181181
Error: expected "]".
182182
,
183-
2 | [a=b ï]{c: d}
183+
2 | [a=b ï] {c: d}
184184
| ^
185185
'
186186
input.scss 2:6 root stylesheet

spec/css/selector/combinator/has.hrx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ More info: https://sass-lang.com/d/bogus-combinators
1515

1616
,
1717
1 | :is(> a) {b: c}
18-
| ^^^^^^^^^
18+
| ^^^^^^^^
1919
'
2020
input.scss 1:1 root stylesheet
2121

@@ -38,7 +38,7 @@ More info: https://sass-lang.com/d/bogus-combinators
3838

3939
,
4040
1 | :is(+ a) {b: c}
41-
| ^^^^^^^^^
41+
| ^^^^^^^^
4242
'
4343
input.scss 1:1 root stylesheet
4444

@@ -61,7 +61,7 @@ More info: https://sass-lang.com/d/bogus-combinators
6161

6262
,
6363
1 | :is(~ a) {b: c}
64-
| ^^^^^^^^^
64+
| ^^^^^^^^
6565
'
6666
input.scss 1:1 root stylesheet
6767

@@ -84,6 +84,6 @@ More info: https://sass-lang.com/d/bogus-combinators
8484

8585
,
8686
1 | :is(+ ~ a) {b: c}
87-
| ^^^^^^^^^^^
87+
| ^^^^^^^^^^
8888
'
8989
input.scss 1:1 root stylesheet

spec/css/selector/combinator/leading.hrx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ More info: https://sass-lang.com/d/bogus-combinators
1414

1515
,
1616
1 | > a {b: c}
17-
| ^^^^
17+
| ^^^
1818
'
1919
input.scss 1:1 root stylesheet
2020

@@ -38,7 +38,7 @@ More info: https://sass-lang.com/d/bogus-combinators
3838

3939
,
4040
1 | + a {b: c}
41-
| ^^^^
41+
| ^^^
4242
'
4343
input.scss 1:1 root stylesheet
4444

@@ -62,7 +62,7 @@ More info: https://sass-lang.com/d/bogus-combinators
6262

6363
,
6464
1 | ~ a {b: c}
65-
| ^^^^
65+
| ^^^
6666
'
6767
input.scss 1:1 root stylesheet
6868

@@ -87,7 +87,7 @@ More info: https://sass-lang.com/d/bogus-combinators
8787

8888
,
8989
1 | + ~ a {b: c}
90-
| ^^^^^^
90+
| ^^^^^
9191
'
9292
input.scss 1:1 root stylesheet
9393

@@ -110,6 +110,6 @@ More info: https://sass-lang.com/d/bogus-combinators
110110

111111
,
112112
1 | > > a {b: c}
113-
| ^^^^^^
113+
| ^^^^^
114114
'
115115
input.scss 1:1 root stylesheet

spec/css/selector/combinator/middle.hrx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ More info: https://sass-lang.com/d/bogus-combinators
4545

4646
,
4747
1 | a > + b {c: d}
48-
| ^^^^^^^^
48+
| ^^^^^^^
4949
'
5050
input.scss 1:1 root stylesheet
5151

@@ -68,6 +68,6 @@ More info: https://sass-lang.com/d/bogus-combinators
6868

6969
,
7070
1 | a~>b {c: d}
71-
| ^^^^^
71+
| ^^^^
7272
'
7373
input.scss 1:1 root stylesheet

spec/css/selector/combinator/only_one_bogus.hrx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ More info: https://sass-lang.com/d/bogus-combinators
1414

1515
,
1616
1 | a, + b {c: d}
17-
| ^^^^^^^
17+
| ^^^
1818
'
19-
input.scss 1:1 root stylesheet
19+
input.scss 1:4 root stylesheet
2020

2121
<===> warning-libsass

spec/css/selector/combinator/selector_pseudo.hrx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ More info: https://sass-lang.com/d/bogus-combinators
4545

4646
,
4747
1 | :is(a > + b) {c: d}
48-
| ^^^^^^^^^^^^^
48+
| ^^^^^^^^^^^^
4949
'
5050
input.scss 1:1 root stylesheet
5151

@@ -68,7 +68,7 @@ More info: https://sass-lang.com/d/bogus-combinators
6868

6969
,
7070
1 | :is(> a) {b: c}
71-
| ^^^^^^^^^
71+
| ^^^^^^^^
7272
'
7373
input.scss 1:1 root stylesheet
7474

@@ -91,7 +91,7 @@ More info: https://sass-lang.com/d/bogus-combinators
9191

9292
,
9393
1 | :is(+ a) {b: c}
94-
| ^^^^^^^^^
94+
| ^^^^^^^^
9595
'
9696
input.scss 1:1 root stylesheet
9797

@@ -114,7 +114,7 @@ More info: https://sass-lang.com/d/bogus-combinators
114114

115115
,
116116
1 | :is(~ a) {b: c}
117-
| ^^^^^^^^^
117+
| ^^^^^^^^
118118
'
119119
input.scss 1:1 root stylesheet
120120

@@ -137,7 +137,7 @@ More info: https://sass-lang.com/d/bogus-combinators
137137

138138
,
139139
1 | :is(+ ~ a) {b: c}
140-
| ^^^^^^^^^^^
140+
| ^^^^^^^^^^
141141
'
142142
input.scss 1:1 root stylesheet
143143

@@ -160,7 +160,7 @@ More info: https://sass-lang.com/d/bogus-combinators
160160

161161
,
162162
1 | :is(a >) {b: c}
163-
| ^^^^^^^^^
163+
| ^^^^^^^^
164164
'
165165
input.scss 1:1 root stylesheet
166166

@@ -183,7 +183,7 @@ More info: https://sass-lang.com/d/bogus-combinators
183183

184184
,
185185
1 | :is(a +) {b: c}
186-
| ^^^^^^^^^
186+
| ^^^^^^^^
187187
'
188188
input.scss 1:1 root stylesheet
189189

@@ -206,7 +206,7 @@ More info: https://sass-lang.com/d/bogus-combinators
206206

207207
,
208208
1 | :is(a ~) {b: c}
209-
| ^^^^^^^^^
209+
| ^^^^^^^^
210210
'
211211
input.scss 1:1 root stylesheet
212212

@@ -229,6 +229,6 @@ More info: https://sass-lang.com/d/bogus-combinators
229229

230230
,
231231
1 | :is(a +) {b: c}
232-
| ^^^^^^^^^
232+
| ^^^^^^^^
233233
'
234234
input.scss 1:1 root stylesheet

spec/css/selector/combinator/trailing.hrx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ More info: https://sass-lang.com/d/bogus-combinators
1616

1717
,
1818
1 | a > {b: c}
19-
| ^^^^ invalid selector
19+
| ^^^ invalid selector
2020
| ==== this is not a style rule
2121
'
2222
input.scss 1:1 root stylesheet
@@ -41,7 +41,7 @@ More info: https://sass-lang.com/d/bogus-combinators
4141

4242
,
4343
1 | a + {b: c}
44-
| ^^^^ invalid selector
44+
| ^^^ invalid selector
4545
| ==== this is not a style rule
4646
'
4747
input.scss 1:1 root stylesheet
@@ -66,7 +66,7 @@ More info: https://sass-lang.com/d/bogus-combinators
6666

6767
,
6868
1 | a ~ {b: c}
69-
| ^^^^ invalid selector
69+
| ^^^ invalid selector
7070
| ==== this is not a style rule
7171
'
7272
input.scss 1:1 root stylesheet
@@ -90,7 +90,7 @@ More info: https://sass-lang.com/d/bogus-combinators
9090

9191
,
9292
1 | a + ~ {b: c}
93-
| ^^^^^^
93+
| ^^^^^
9494
'
9595
input.scss 1:1 root stylesheet
9696

@@ -113,6 +113,6 @@ More info: https://sass-lang.com/d/bogus-combinators
113113

114114
,
115115
1 | a > > {b: c}
116-
| ^^^^^^
116+
| ^^^^^
117117
'
118118
input.scss 1:1 root stylesheet

0 commit comments

Comments
 (0)