Skip to content

Commit 1d11500

Browse files
committed
test: parse: Improve colour testing
1 parent 3b35bfa commit 1d11500

File tree

4 files changed

+284
-0
lines changed

4 files changed

+284
-0
lines changed

test/data/parse/INDEX

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ selectors.dat Selectors
77
atrules.dat @-rules
88
colours.dat Colour values
99
colours-hsl.dat HSL Colour values
10+
colours-hwb.dat HWB Colour values
1011
nth.dat :nth-* expressions
1112
properties.dat Properties

test/data/parse/colours-hsl.dat

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,136 @@
99
| 0x02000018 0xffff0000
1010
#reset
1111

12+
#data
13+
* { color: hsl(0 100% 50%) }
14+
#errors
15+
#expected
16+
| 1 *
17+
| 0x02000018 0xffff0000
18+
#reset
19+
20+
#data
21+
* { color: hsl(0, 100%, 50%, 100%) }
22+
#errors
23+
#expected
24+
| 1 *
25+
| 0x02000018 0xffff0000
26+
#reset
27+
28+
#data
29+
* { color: hsl(0 100% 50% / 0.5) }
30+
#errors
31+
#expected
32+
| 1 *
33+
| 0x02000018 0x7fff0000
34+
#reset
35+
36+
#data
37+
* { color: hsl(0 100% 50%/0.5) }
38+
#errors
39+
#expected
40+
| 1 *
41+
| 0x02000018 0x7fff0000
42+
#reset
43+
44+
#data
45+
* { color: hsl(0 100% 50/0.5) }
46+
#errors
47+
#expected
48+
| 1 *
49+
| 0x02000018 0x7fff0000
50+
#reset
51+
52+
#data
53+
* { color: hsl(0 100% 50% / 50%) }
54+
#errors
55+
#expected
56+
| 1 *
57+
| 0x02000018 0x7fff0000
58+
#reset
59+
60+
#data
61+
* { color: hsla(0 100% 50% / 50%) }
62+
#errors
63+
#expected
64+
| 1 *
65+
| 0x02000018 0x7fff0000
66+
#reset
67+
68+
#data
69+
* { color: hsl(0 100% 50% / 1) }
70+
#errors
71+
#expected
72+
| 1 *
73+
| 0x02000018 0xffff0000
74+
#reset
75+
76+
#data
77+
* { color: hsl(0 100% 50%, 1) }
78+
#errors
79+
#expected
80+
| 1 *
81+
#reset
82+
83+
#data
84+
* { color: hsl(0 , 100% , 50% , 1) }
85+
#errors
86+
#expected
87+
| 1 *
88+
| 0x02000018 0xffff0000
89+
#reset
90+
91+
#data
92+
* { color: hsla(0 , 100% , 50% , 1) }
93+
#errors
94+
#expected
95+
| 1 *
96+
| 0x02000018 0xffff0000
97+
#reset
98+
99+
#data
100+
* { color: hsl(0 , 100% , 50% , 1 ,) }
101+
#errors
102+
#expected
103+
| 1 *
104+
#reset
105+
106+
#data
107+
* { color: hsl(0 , 100% , 50% ,) }
108+
#errors
109+
#expected
110+
| 1 *
111+
#reset
112+
113+
#data
114+
* { color: hsl(0,100%,50%) }
115+
#errors
116+
#expected
117+
| 1 *
118+
| 0x02000018 0xffff0000
119+
#reset
120+
121+
#data
122+
* { color: hsl(0, 100% 50%) }
123+
#errors
124+
#expected
125+
| 1 *
126+
#reset
127+
128+
#data
129+
* { color: hsl(0 100%, 50%) }
130+
#errors
131+
#expected
132+
| 1 *
133+
#reset
134+
135+
#data
136+
* { color: hsla(0 100%, 50%) }
137+
#errors
138+
#expected
139+
| 1 *
140+
#reset
141+
12142
## yellow
13143
#data
14144
* { color: hsl(60, 100%, 50%) }
@@ -18,6 +148,15 @@
18148
| 0x02000018 0xffffff00
19149
#reset
20150

151+
## yellow
152+
#data
153+
* { color: hsl(60deg, 100%, 50%) }
154+
#errors
155+
#expected
156+
| 1 *
157+
| 0x02000018 0xffffff00
158+
#reset
159+
21160
## green
22161
#data
23162
* { color: hsl(120, 100%, 50%) }

test/data/parse/colours-hwb.dat

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
## simple hwb color values
2+
3+
## red
4+
#data
5+
* { color: hwb(0, 100%, 50%) }
6+
#errors
7+
#expected
8+
| 1 *
9+
#reset
10+
11+
#data
12+
* { color: hwba(0 100% 50% / 50%) }
13+
#errors
14+
#expected
15+
| 1 *
16+
#reset
17+
18+
#data
19+
* { color: hwb(0 100% 50%) }
20+
#errors
21+
#expected
22+
| 1 *
23+
| 0x02000018 0xffaaaaaa
24+
#reset
25+
26+
#data
27+
* { color: hwb(0, 100%, 50%, 100%) }
28+
#errors
29+
#expected
30+
| 1 *
31+
#reset
32+
33+
#data
34+
* { color: hwb(0 100%, 50%, 100%) }
35+
#errors
36+
#expected
37+
| 1 *
38+
#reset
39+
40+
#data
41+
* { color: hwb(0 100%, 50%) }
42+
#errors
43+
#expected
44+
| 1 *
45+
#reset
46+
47+
#data
48+
* { color: hwb(0 100% 50% 100%) }
49+
#errors
50+
#expected
51+
| 1 *
52+
#reset
53+
54+
#data
55+
* { color: hwb(0 100% 50% / 0.5) }
56+
#errors
57+
#expected
58+
| 1 *
59+
| 0x02000018 0x7faaaaaa
60+
#reset
61+
62+
#data
63+
* { color: hwb(0 100% 50% / 50%) }
64+
#errors
65+
#expected
66+
| 1 *
67+
| 0x02000018 0x7faaaaaa
68+
#reset
69+
70+
#data
71+
* { color: hwb(0 100% 50% / 1) }
72+
#errors
73+
#expected
74+
| 1 *
75+
| 0x02000018 0xffaaaaaa
76+
#reset
77+
78+
#data
79+
* { color: hwb(0 100% 50%, 1) }
80+
#errors
81+
#expected
82+
| 1 *
83+
#reset
84+
85+
#data
86+
* { color: hwb(0 , 100% , 50% , 1) }
87+
#errors
88+
#expected
89+
| 1 *
90+
#reset
91+
92+
#data
93+
* { color: hwb(0 , 100% , 50% , 1 ,) }
94+
#errors
95+
#expected
96+
| 1 *
97+
#reset
98+
99+
#data
100+
* { color: hwb(0 , 100% , 50% ,) }
101+
#errors
102+
#expected
103+
| 1 *
104+
#reset
105+
106+
#data
107+
* { color: hwb(267 19% 60%) }
108+
#errors
109+
#expected
110+
| 1 *
111+
| 0x02000018 0xff483066
112+
#reset
113+
114+
#data
115+
* { color: hwb(267 19% 60% / 0.5) }
116+
#errors
117+
#expected
118+
| 1 *
119+
| 0x02000018 0x7f483066
120+
#reset
121+
122+
#data
123+
* { color: hwb(267 19% 60% / 50%) }
124+
#errors
125+
#expected
126+
| 1 *
127+
| 0x02000018 0x7f483066
128+
#reset
129+
130+
#data
131+
* { color: hwb(267 19% 60%/50%) }
132+
#errors
133+
#expected
134+
| 1 *
135+
| 0x02000018 0x7f483066
136+
#reset

test/data/parse/colours.dat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@
8080
| 0x02000018 0x7f0000ff
8181
#reset
8282

83+
#data
84+
* { color: rgb(none 0% 255/0.5) }
85+
#errors
86+
#expected
87+
| 1 *
88+
| 0x02000018 0x7f0000ff
89+
#reset
90+
8391
#data
8492
* { color: rgb(none 0% 255 none) }
8593
#errors

0 commit comments

Comments
 (0)