Skip to content

Commit 652e002

Browse files
committed
test(selector-node-loc-fixing): added tests
1 parent ba98577 commit 652e002

9 files changed

+1016
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<script>
2+
let a = 10
3+
</script>
4+
5+
<span class="myClass">Hello!</span>
6+
7+
<b>{a}</b>
8+
9+
<style>
10+
.myClass {
11+
color: red;
12+
}
13+
14+
b {
15+
font-size: xx-large;
16+
}
17+
18+
a:active,
19+
a::before,
20+
b + a,
21+
b + .myClass,
22+
a[data-key="value"] {
23+
color: blue;
24+
}
25+
</style>
Lines changed: 281 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,281 @@
1+
[
2+
[
3+
[
4+
"selector",
5+
{
6+
"start": {
7+
"line": 10,
8+
"column": 2
9+
},
10+
"end": {
11+
"line": 10,
12+
"column": 10
13+
}
14+
}
15+
],
16+
[
17+
"class",
18+
{
19+
"start": {
20+
"line": 10,
21+
"column": 2
22+
},
23+
"end": {
24+
"line": 10,
25+
"column": 10
26+
}
27+
}
28+
]
29+
],
30+
[
31+
[
32+
"selector",
33+
{
34+
"start": {
35+
"line": 14,
36+
"column": 2
37+
},
38+
"end": {
39+
"line": 14,
40+
"column": 3
41+
}
42+
}
43+
],
44+
[
45+
"tag",
46+
{
47+
"start": {
48+
"line": 14,
49+
"column": 2
50+
},
51+
"end": {
52+
"line": 14,
53+
"column": 3
54+
}
55+
}
56+
]
57+
],
58+
[
59+
[
60+
"selector",
61+
{
62+
"start": {
63+
"line": 18,
64+
"column": 2
65+
},
66+
"end": {
67+
"line": 18,
68+
"column": 10
69+
}
70+
}
71+
],
72+
[
73+
"tag",
74+
{
75+
"start": {
76+
"line": 18,
77+
"column": 2
78+
},
79+
"end": {
80+
"line": 18,
81+
"column": 3
82+
}
83+
}
84+
],
85+
[
86+
"pseudo",
87+
{
88+
"start": {
89+
"line": 18,
90+
"column": 3
91+
},
92+
"end": {
93+
"line": 18,
94+
"column": 10
95+
}
96+
}
97+
],
98+
[
99+
"selector",
100+
{
101+
"start": {
102+
"line": 19,
103+
"column": -1
104+
},
105+
"end": {
106+
"line": 19,
107+
"column": 11
108+
}
109+
}
110+
],
111+
[
112+
"tag",
113+
{
114+
"start": {
115+
"line": 19,
116+
"column": 2
117+
},
118+
"end": {
119+
"line": 19,
120+
"column": 3
121+
}
122+
}
123+
],
124+
[
125+
"pseudo",
126+
{
127+
"start": {
128+
"line": 19,
129+
"column": 3
130+
},
131+
"end": {
132+
"line": 19,
133+
"column": 11
134+
}
135+
}
136+
],
137+
[
138+
"selector",
139+
{
140+
"start": {
141+
"line": 20,
142+
"column": -1
143+
},
144+
"end": {
145+
"line": 20,
146+
"column": 7
147+
}
148+
}
149+
],
150+
[
151+
"tag",
152+
{
153+
"start": {
154+
"line": 20,
155+
"column": 2
156+
},
157+
"end": {
158+
"line": 20,
159+
"column": 3
160+
}
161+
}
162+
],
163+
[
164+
"combinator",
165+
{
166+
"start": {
167+
"line": 20,
168+
"column": 4
169+
},
170+
"end": {
171+
"line": 20,
172+
"column": 5
173+
}
174+
}
175+
],
176+
[
177+
"tag",
178+
{
179+
"start": {
180+
"line": 20,
181+
"column": 6
182+
},
183+
"end": {
184+
"line": 20,
185+
"column": 7
186+
}
187+
}
188+
],
189+
[
190+
"selector",
191+
{
192+
"start": {
193+
"line": 21,
194+
"column": -1
195+
},
196+
"end": {
197+
"line": 21,
198+
"column": 14
199+
}
200+
}
201+
],
202+
[
203+
"tag",
204+
{
205+
"start": {
206+
"line": 21,
207+
"column": 2
208+
},
209+
"end": {
210+
"line": 21,
211+
"column": 3
212+
}
213+
}
214+
],
215+
[
216+
"combinator",
217+
{
218+
"start": {
219+
"line": 21,
220+
"column": 4
221+
},
222+
"end": {
223+
"line": 21,
224+
"column": 5
225+
}
226+
}
227+
],
228+
[
229+
"class",
230+
{
231+
"start": {
232+
"line": 21,
233+
"column": 6
234+
},
235+
"end": {
236+
"line": 21,
237+
"column": 14
238+
}
239+
}
240+
],
241+
[
242+
"selector",
243+
{
244+
"start": {
245+
"line": 22,
246+
"column": -1
247+
},
248+
"end": {
249+
"line": 22,
250+
"column": 21
251+
}
252+
}
253+
],
254+
[
255+
"tag",
256+
{
257+
"start": {
258+
"line": 22,
259+
"column": 2
260+
},
261+
"end": {
262+
"line": 22,
263+
"column": 3
264+
}
265+
}
266+
],
267+
[
268+
"attribute",
269+
{
270+
"start": {
271+
"line": 22,
272+
"column": 3
273+
},
274+
"end": {
275+
"line": 22,
276+
"column": 21
277+
}
278+
}
279+
]
280+
]
281+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<div class="container">
2+
<div class="div-class">Hello</div>
3+
4+
<span class="span-class">World!</span>
5+
</div>
6+
7+
<style lang="postcss">
8+
body {
9+
colour: white;
10+
background-colour: grey;
11+
}
12+
13+
a:active,
14+
a::before,
15+
b + a,
16+
b + .myClass,
17+
a[data-key="value"] {
18+
color: blue;
19+
}
20+
</style>

0 commit comments

Comments
 (0)