40
40
41
41
import static org .owasp .html .CssTokens .TokenType .*;
42
42
43
+ @ SuppressWarnings ({ "javadoc" })
43
44
public class CssTokensTest extends TestCase {
44
45
45
46
private static CssTokens lex (String s ) {
@@ -81,15 +82,15 @@ public static final void testBracketIndices() {
81
82
}
82
83
83
84
@ Test
84
- public static final void testStringEscaping () throws Exception {
85
+ public static final void testStringEscaping () {
85
86
// input golden
86
87
String [] tests = {
87
88
"''" , "''" ,
88
89
"\" \" " , "''" ,
89
90
"\" \\ a\" " , "'\\ a'" ,
90
91
"\" \\ 0d\\ 0a\" " , "'\\ d\\ a'" ,
91
92
"'\\ 000000d'" , "'\\ 0 d'" , // too many hex digits
92
- "'\\ 1fffff'" , "'\ufffd '" , // exceeeds max codepoint
93
+ "'\\ 1fffff'" , "'\ufffd '" , // exceeds max codepoint
93
94
"\" '\" " , "'\\ 27'" ,
94
95
"\" \\ \" \" " , "'\\ 22'" ,
95
96
"'\\ \\ '" , "'\\ \\ '" ,
@@ -128,7 +129,7 @@ public static final void testStringEscaping() throws Exception {
128
129
}
129
130
130
131
@ Test
131
- public static final void testComments () throws Exception {
132
+ public static final void testComments () {
132
133
assertEquals (
133
134
"a b c d e f g h" ,
134
135
lex (
@@ -137,12 +138,12 @@ public static final void testComments() throws Exception {
137
138
}
138
139
139
140
@ Test
140
- public static final void testNonCommentSlash () throws Exception {
141
+ public static final void testNonCommentSlash () {
141
142
assertEquals ("foo/ bar/" , lex ("foo/bar/" ).normalizedCss );
142
143
}
143
144
144
145
@ Test
145
- public static final void testCdoCdc () throws Exception {
146
+ public static final void testCdoCdc () {
146
147
assertEquals (
147
148
"|| and are ignorable||" ,
148
149
lex ("||<!-- and --> are ignorable||" ).normalizedCss );
@@ -152,7 +153,7 @@ public static final void testCdoCdc() throws Exception {
152
153
}
153
154
154
155
@ Test
155
- public static final void testIdentReencoding () throws Exception {
156
+ public static final void testIdentReencoding () {
156
157
// input golden
157
158
String [] tests = {
158
159
"\\ " , null ,
@@ -222,12 +223,12 @@ public static final void testIdentReencoding() throws Exception {
222
223
}
223
224
224
225
@ Test
225
- public static final void testOrphanedCloseBrackets () throws Exception {
226
+ public static final void testOrphanedCloseBrackets () {
226
227
assertEquals ("{foo bar}" , lex ("{foo]bar" ).normalizedCss );
227
228
}
228
229
229
230
@ Test
230
- public static final void testAtDirectives () throws Exception {
231
+ public static final void testAtDirectives () {
231
232
assertTokens (
232
233
"@import \" foo/bar\" ; @ at, @34" ,
233
234
"@import:AT" , " " , "'foo/bar':STRING" , ";:SEMICOLON" ,
@@ -236,7 +237,7 @@ public static final void testAtDirectives() throws Exception {
236
237
}
237
238
238
239
@ Test
239
- public static final void testHash () throws Exception {
240
+ public static final void testHash () {
240
241
assertTokens (
241
242
"#fff #foo #-moz-foo #abcd #abcdef #012f34 #888 #42foo # #" ,
242
243
"#fff:HASH_UNRESTRICTED" , " " ,
@@ -251,7 +252,7 @@ public static final void testHash() throws Exception {
251
252
}
252
253
253
254
@ Test
254
- public static final void testSignsAndDots () throws Exception {
255
+ public static final void testSignsAndDots () {
255
256
assertTokens (
256
257
"- . + +1 + 1 (1 + 1)--> .5 -.5 +.5 ++.5 .foo -" ,
257
258
"-:IDENT" , " " , ".:DELIM" , " " , "+:DELIM" , " " , "1:NUMBER" , " " ,
@@ -262,7 +263,7 @@ public static final void testSignsAndDots() throws Exception {
262
263
// TODO: is a single "-" an IDENT or a DELIM? "--"? "---"?
263
264
}
264
265
265
- public static final void testMultiCharPunctuation () throws Exception {
266
+ public static final void testMultiCharPunctuation () {
266
267
assertTokens (
267
268
"|| ~= === |= =^= $= *= = : % & ~" ,
268
269
"||:COLUMN" , " " , "~=:MATCH" , " " , "=:DELIM" , "=:DELIM" , "=:DELIM" , " " ,
@@ -272,13 +273,13 @@ public static final void testMultiCharPunctuation() throws Exception {
272
273
}
273
274
274
275
@ Test
275
- public static final void testNul () throws Exception {
276
+ public static final void testNul () {
276
277
assertTokens ("\u0000 " );
277
278
assertTokens ("\u0000 x\u0000 " , "x:IDENT" );
278
279
}
279
280
280
281
@ Test
281
- public static final void testNumbers () throws Exception {
282
+ public static final void testNumbers () {
282
283
assertTokens (
283
284
"0 -0 +0 0.0 -0.0 -.0 0e12 0e-12 0e+12" ,
284
285
"0:NUMBER" , " " ,
@@ -314,7 +315,7 @@ public static final void testNumbers() throws Exception {
314
315
}
315
316
316
317
@ Test
317
- public static final void testUrls () throws Exception {
318
+ public static final void testUrls () {
318
319
assertTokens (
319
320
"url() url('..')url( \" foo\" ) URL( f\" /(bar'\\ \\ baz ) url('foo \\ a b')"
320
321
+ "Url( \u0080 \u1234 \ud801 \udc02 \\ 110000)" ,
@@ -328,7 +329,7 @@ public static final void testUrls() throws Exception {
328
329
}
329
330
330
331
@ Test
331
- public static final void testFunctions () throws Exception {
332
+ public static final void testFunctions () {
332
333
assertTokens ("( rgb(0,0,0) rgba(0,50%,0,100%)" ,
333
334
"(:LEFT_PAREN" ,
334
335
" " ,
0 commit comments