/[suikacvs]/markup/html/whatpm/t/css-token-1.test
Suika

Contents of /markup/html/whatpm/t/css-token-1.test

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Sat Sep 8 11:16:13 2007 UTC (17 years, 10 months ago) by wakaba
Branch: MAIN
Changes since 1.3: +77 -1 lines
*** empty log message ***

1 wakaba 1.1 {"tests": [
2     {"description": "empty",
3     "input": "",
4     "output": []},
5    
6     {"description": "length=1 IDENT (lowercase)",
7     "input": "a",
8     "output": [["IDENT", "a"]]},
9    
10     {"description": "length=1 IDENT (uppercase)",
11     "input": "A",
12     "output": [["IDENT", "A"]]},
13    
14     {"description": "length=2 IDENT (uppercase)",
15     "input": "AB",
16     "output": [["IDENT", "AB"]]},
17    
18     {"description": "length=2 IDENT (lowercase)",
19     "input": "ab",
20     "output": [["IDENT", "ab"]]},
21    
22 wakaba 1.2 {"description": "\\",
23     "input": "\\",
24     "output": [["DELIM", "\\"]]},
25    
26 wakaba 1.1 {"description": "IDENT started by escape 1",
27     "input": "\\41",
28     "output": [["IDENT", "A"]]},
29    
30     {"description": "IDENT started by escape 2",
31     "input": "\\041",
32     "output": [["IDENT", "A"]]},
33    
34     {"description": "IDENT started by escape 3",
35     "input": "\\0041",
36     "output": [["IDENT", "A"]]},
37    
38     {"description": "IDENT started by escape 4",
39     "input": "\\00041",
40     "output": [["IDENT", "A"]]},
41    
42     {"description": "IDENT started by escape 5",
43     "input": "\\000041",
44     "output": [["IDENT", "A"]]},
45    
46     {"description": "IDENT started by escape 6",
47     "input": "\\0000041",
48     "output": [["IDENT", "\u00041"]]},
49    
50     {"description": "IDENT started by escape 7",
51     "input": "\\00000041",
52     "output": [["IDENT", "\u000041"]]},
53    
54     {"description": "IDENT started by escape followed by a space 1",
55     "input": "\\41 ",
56     "output": [["IDENT", "A"]]},
57    
58     {"description": "IDENT started by escape followed by a space 2",
59     "input": "\\41 a",
60     "output": [["IDENT", "Aa"]]},
61    
62     {"description": "IDENT started by escape followed by a space 3",
63     "input": "\\41\u0009a",
64     "output": [["IDENT", "Aa"]]},
65    
66     {"description": "IDENT started by escape followed by a space 4",
67     "input": "\\000041 ",
68     "output": [["IDENT", "A"]]},
69    
70     {"description": "IDENT started by escape followed by a space 5",
71     "input": "\\000041\u000D\u000A",
72 wakaba 1.2 "output": [["IDENT", "A"]]},
73    
74     {"description": "\\\u000D",
75     "input": "\\\u000D",
76     "output": [["DELIM", "\\"], ["S"]]},
77    
78     {"description": "\\\u000D\u000A",
79     "input": "\\\u000D\u000A",
80     "output": [["DELIM", "\\"], ["S"]]},
81    
82     {"description": "\\\u000D\\\u000A",
83     "input": "\\\u000D\\\u000A",
84     "output": [["DELIM", "\\"], ["S"], ["DELIM", "\\"], ["S"]]},
85    
86     {"description": "\\\u000C",
87     "input": "\\\u000C",
88     "output": [["DELIM", "\\"], ["S"]]},
89    
90     {"description": "\\\u000A",
91     "input": "\\\u000A",
92     "output": [["DELIM", "\\"], ["S"]]},
93    
94     {"description": "\\ ",
95     "input": "\\ ",
96     "output": [["IDENT", " "]]},
97    
98     {"description": "\\\\",
99     "input": "\\\\",
100     "output": [["IDENT", "\\"]]},
101    
102     {"description": "\\\\\\",
103     "input": "\\\\\\",
104     "output": [["IDENT", "\\"], ["DELIM", "\\"]]},
105    
106     {"description": "\\\u0009",
107     "input": "\\\u0009",
108     "output": [["IDENT", "\u0009"]]},
109    
110     {"description": "\\X",
111     "input": "\\X",
112     "output": [["IDENT", "X"]]},
113    
114     {"description": "a\\",
115     "input": "a\\",
116     "output": [["IDENT", "a"], ["DELIM", "\\"]]},
117    
118     {"description": "a\\f1",
119     "input": "a\\f1",
120     "output": [["IDENT", "a\u00f1"]]},
121    
122     {"description": "a\\F1",
123     "input": "a\\F1",
124     "output": [["IDENT", "a\u00f1"]]},
125    
126     {"description": "a\\0f1",
127     "input": "a\\0f1",
128     "output": [["IDENT", "a\u00f1"]]},
129    
130     {"description": "a\\0F1",
131     "input": "a\\0F1",
132     "output": [["IDENT", "a\u00f1"]]},
133    
134     {"description": "a\\41",
135     "input": "a\\41",
136     "output": [["IDENT", "aA"]]},
137    
138     {"description": "a\\41 b",
139     "input": "a\\41 b",
140     "output": [["IDENT", "aAb"]]},
141    
142     {"description": "a\\41\u0009X",
143     "input": "a\\41\u0009X",
144     "output": [["IDENT", "aAX"]]},
145    
146     {"description": "a\\4e00",
147     "input": "a\\4e00",
148     "output": [["IDENT", "a\u4e00"]]},
149    
150     {"description": "a\\41 X",
151     "input": "a\\41 X",
152     "output": [["IDENT", "aA"], ["S"], ["IDENT", "X"]]},
153    
154     {"description": "a\\ ",
155     "input": "a\\ ",
156     "output": [["IDENT", "a "]]},
157    
158     {"description": "a\\ b",
159     "input": "a\\ b",
160     "output": [["IDENT", "a b"]]},
161    
162     {"description": "a\\\\b",
163     "input": "a\\\\b",
164     "output": [["IDENT", "a\\b"]]},
165    
166     {"description": "a\\\u0009b",
167     "input": "a\\\u0009b",
168     "output": [["IDENT", "a\u0009b"]]},
169    
170     {"description": "a\\GB",
171     "input": "a\\GB",
172     "output": [["IDENT", "aGB"]]},
173    
174     {"description": "a\\\u000D",
175     "input": "a\\\u000D",
176     "output": [["IDENT", "a"], ["DELIM", "\\"], ["S"]]},
177    
178     {"description": "a\\\u000A",
179     "input": "a\\\u000A",
180     "output": [["IDENT", "a"], ["DELIM", "\\"], ["S"]]},
181    
182     {"description": "a\\\u000D\u000A",
183     "input": "a\\\u000D\u000A",
184     "output": [["IDENT", "a"], ["DELIM", "\\"], ["S"]]},
185    
186     {"description": "a\\\u000D\\\u000A",
187     "input": "a\\\u000D\\\u000A",
188     "output": [["IDENT", "a"], ["DELIM", "\\"], ["S"], ["DELIM", "\\"], ["S"]]},
189    
190     {"description": "a\\\u000C",
191     "input": "a\\\u000C",
192     "output": [["IDENT", "a"], ["DELIM", "\\"], ["S"]]},
193    
194     {"description": "-",
195     "input": "-",
196     "output": [["DELIM", "-"]]},
197    
198     {"description": "\\-",
199     "input": "\\-",
200     "output": [["IDENT", "-"]]},
201    
202     {"description": "-i",
203     "input": "-i",
204     "output": [["IDENT", "-i"]]},
205    
206     {"description": "\\-i",
207     "input": "\\-i",
208     "output": [["IDENT", "-i"]]},
209    
210     {"description": "-ident",
211     "input": "-ident",
212     "output": [["IDENT", "-ident"]]},
213    
214     {"description": "\\-ident",
215     "input": "\\-ident",
216     "output": [["IDENT", "-ident"]]},
217    
218     {"description": "-ident-ident",
219     "input": "-ident-ident",
220     "output": [["IDENT", "-ident-ident"]]},
221    
222     {"description": "\\-ident-ident",
223     "input": "\\-ident-ident",
224     "output": [["IDENT", "-ident-ident"]]},
225    
226     {"description": "-1",
227     "input": "-1",
228     "output": [["DELIM", "-"], ["NUMBER", "1"]]},
229    
230     {"description": "\\-1",
231     "input": "\\-1",
232     "output": [["IDENT", "-1"]]},
233    
234     {"description": "-1a",
235     "input": "-1a",
236     "output": [["DELIM", "-"], ["DIMENSION", "1", "a"]]},
237    
238     {"description": "\\-1a",
239     "input": "\\-1a",
240     "output": [["IDENT", "-1a"]]},
241    
242     {"description": "-\\31",
243     "input": "-\\31",
244     "output": [["IDENT", "-1"]]},
245    
246     {"description": "\\-\\31",
247     "input": "\\-\\31",
248     "output": [["IDENT", "-1"]]},
249    
250     {"description": "-\\41",
251     "input": "-\\41",
252     "output": [["IDENT", "-A"]]},
253    
254     {"description": "\\-\\41",
255     "input": "\\-\\41",
256     "output": [["IDENT", "-A"]]},
257    
258     {"description": "-\\\u000D",
259     "input": "-\\\u000D",
260     "output": [["DELIM", "-"], ["DELIM", "\\"], ["S"]]},
261    
262     {"description": "\\-\\\u000D",
263     "input": "\\-\\\u000D",
264     "output": [["IDENT", "-"], ["DELIM", "\\"], ["S"]]},
265    
266     {"description": "\u4e00",
267     "input": "\u4e00",
268     "output": [["IDENT", "\u4e00"]]},
269    
270     {"description": "a\u4e00b",
271     "input": "a\u4e00b",
272     "output": [["IDENT", "a\u4e00b"]]},
273    
274     {"description": "@",
275     "input": "@",
276     "output": [["DELIM", "@"]]},
277    
278     {"description": "@a",
279     "input": "@a",
280     "output": [["ATKEYWORD", "a"]]},
281    
282     {"description": "@A",
283     "input": "@A",
284     "output": [["ATKEYWORD", "A"]]},
285    
286     {"description": "@abc",
287     "input": "@abc",
288     "output": [["ATKEYWORD", "abc"]]},
289    
290     {"description": "@-",
291     "input": "@-",
292     "output": [["DELIM", "@"], ["DELIM", "-"]]},
293    
294     {"description": "@-a",
295     "input": "@-a",
296     "output": [["ATKEYWORD", "-a"]]},
297    
298     {"description": "@1",
299     "input": "@1",
300     "output": [["DELIM", "@"], ["NUMBER", "1"]]},
301    
302     {"description": "@-1",
303     "input": "@-1",
304     "output": [["DELIM", "@"], ["DELIM", "-"], ["NUMBER", "1"]]},
305    
306     {"description": "@\\41",
307     "input": "@\\41",
308     "output": [["ATKEYWORD", "A"]]},
309    
310     {"description": "@\\61 b",
311     "input": "@\\61 b",
312     "output": [["ATKEYWORD", "ab"]]},
313    
314     {"description": "@\\61 b",
315     "input": "@\\61 b",
316     "output": [["ATKEYWORD", "a"], ["S"], ["IDENT", "b"]]},
317    
318     {"description": "@a\\41",
319     "input": "@aA",
320     "output": [["ATKEYWORD", "aA"]]},
321    
322     {"description": "@a\\4e00X",
323     "input": "@a\\4e00X",
324 wakaba 1.3 "output": [["ATKEYWORD", "a\u4e00X"]]},
325    
326     {"description": "\"",
327     "input": "\"",
328     "output": [["INVALID", ""]]},
329    
330     {"description": "'",
331     "input": "'",
332     "output": [["INVALID", ""]]},
333    
334     {"description": "\"\"",
335     "input": "\"\"",
336     "output": [["STRING", ""]]},
337    
338     {"description": "''",
339     "input": "''",
340     "output": [["STRING", ""]]},
341    
342     {"description": "\"a",
343     "input": "\"a",
344     "output": [["INVALID", "a"]]},
345    
346     {"description": "'a",
347     "input": "'a",
348     "output": [["INVALID", "a"]]},
349    
350     {"description": "'a'",
351     "input": "'a'",
352     "output": [["STRING", "a"]]},
353    
354     {"description": "\"a\"",
355     "input": "\"a\"",
356     "output": [["STRING", "a"]]},
357    
358     {"description": "'a'",
359     "input": "'a'",
360     "output": [["STRING", "a"]]},
361    
362     {"description": "\"a'",
363     "input": "\"a'",
364     "output": [["INVALID", "a'"]]},
365    
366     {"description": "'a\"",
367     "input": "'a\"",
368     "output": [["INVALID", "a\""]]},
369    
370     {"description": "\"A",
371     "input": "\"A",
372     "output": [["INVALID", "A"]]},
373    
374     {"description": "'A",
375     "input": "'A",
376     "output": [["INVALID", "A"]]},
377    
378     {"description": "\"A\"",
379     "input": "\"A\"",
380     "output": [["STRING", "A"]]},
381    
382     {"description": "'A'",
383     "input": "'A'",
384     "output": [["STRING", "A"]]},
385    
386     {"description": "\"A'",
387     "input": "\"A'",
388     "output": [["INVALID", "A'"]]},
389    
390     {"description": "'A\"",
391     "input": "'A\"",
392     "output": [["INVALID", "A\""]]},
393    
394     {"description": "\"abc",
395     "input": "\"abc",
396     "output": [["INVALID", "abc"]]},
397    
398     {"description": "'abc",
399     "input": "'abc",
400     "output": [["INVALID", "abc"]]},
401    
402     {"description": "\"abc\"",
403     "input": "\"abc\"",
404     "output": [["STRING", "abc"]]},
405    
406     {"description": "'abc'",
407     "input": "'abc'",
408     "output": [["STRING", "abc"]]},
409    
410     {"description": "\"a\\",
411     "input": "\"a\\",
412     "output": [["INVALID", "a"], ["DELIM", "\\"]]},
413    
414     {"description": "'a\\",
415     "input": "'a\\",
416     "output": [["INVALID", "a"], ["DELIM", "\\"]]},
417    
418     {"description": "\"\\",
419     "input": "\"\\",
420     "output": [["INVALID", ""], ["DELIM", "\\"]]},
421    
422     {"description": "'\\",
423     "input": "'\\",
424     "output": [["INVALID", ""], ["DELIM", "\\"]]},
425    
426     {"description": "\"a\\\"",
427     "input": "\"a\\\"",
428     "output": [["INVALID", "a\""]]},
429    
430     {"description": "'a\\\"",
431     "input": "'a\\\"",
432     "output": [["INVALID", "a\""]]},
433    
434     {"description": "'a\\'",
435     "input": "'a\\'",
436     "output": [["INVALID", "a'"]]},
437    
438     {"description": "\"\\\"",
439     "input": "\"\\\"",
440     "output": [["INVALID", "\""]]},
441    
442     {"description": "'\\\"",
443     "input": "'\\\"",
444     "output": [["INVALID", "\""]]},
445    
446     {"description": "'\\'",
447     "input": "'\\'",
448     "output": [["INVALID", "'"]]},
449    
450     {"description": "'\\\\\"",
451     "input": "'\\\\\"",
452     "output": [["INVALID", "\\\""]]},
453    
454     {"description": "\"a\\'",
455     "input": "\"a\\'",
456     "output": [["INVALID", "a'"]]},
457    
458     {"description": "\"a\\x",
459     "input": "\"a\\x",
460     "output": [["INVALID", "ax"]]},
461    
462     {"description": "\"\\x",
463     "input": "\"\\x",
464     "output": [["INVALID", "x"]]},
465    
466     {"description": "'\\x",
467     "input": "'\\x",
468     "output": [["INVALID", "x"]]},
469    
470     {"description": "\"a\\x\"",
471     "input": "\"a\\x\"",
472     "output": [["STRING", "ax"]]},
473    
474     {"description": "\"\\x \"",
475     "input": "\"\\x \"",
476     "output": [["STRING", "x "]]},
477    
478     {"description": "\"a\\x \"",
479     "input": "\"a\\x \"",
480     "output": [["STRING", "ax "]]},
481    
482     {"description": "\"\\31",
483     "input": "\"\\31",
484     "output": [["INVALID", "1"]]},
485    
486     {"description": "\"a\\31",
487     "input": "\"a\\31",
488     "output": [["INVALID", "a1"]]},
489    
490     {"description": "'a\\31",
491     "input": "'a\\31",
492     "output": [["INVALID", "a1"]]},
493    
494     {"description": "\"\\31\"",
495     "input": "\"\\31\"",
496     "output": [["STRING", "1"]]},
497    
498     {"description": "'\\31'",
499     "input": "'\\31'",
500     "output": [["STRING", "1"]]},
501    
502     {"description": "\"a\\31\"",
503     "input": "\"a\\31\"",
504     "output": [["STRING", "a1"]]},
505    
506     {"description": "\"\\31 ",
507     "input": "\"\\31 ",
508     "output": [["INVALID", "1"]]},
509    
510     {"description": "\"a\\31 ",
511     "input": "\"a\\31 ",
512     "output": [["INVALID", "a1"]]},
513    
514     {"description": "\"a\\31 \"",
515     "input": "\"a\\31 \"",
516     "output": [["STRING", "a1"]]},
517    
518     {"description": "\"\\\u000D",
519     "input": "\"\\\u000D",
520     "output": [["INVALID", "\u000D"]]},
521    
522     {"description": "'\\\u000D",
523     "input": "'\\\u000D",
524     "output": [["INVALID", "\u000D"]]},
525    
526     {"description": "\"a\\\u000D",
527     "input": "\"a\\\u000D",
528     "output": [["INVALID", "a\u000D"]]},
529    
530     {"description": "\"a\\\u000D\"",
531     "input": "\"a\\\u000D\"",
532     "output": [["STRING", "a\u000D"]]},
533    
534     {"description": "'a\\\u000D'",
535     "input": "'a\\\u000D'",
536     "output": [["STRING", "a\u000D"]]},
537    
538     {"description": "\"a\\\u000D\u000A",
539     "input": "\"a\\\u000D\u000A",
540     "output": [["INVALID", "a\u000D\u000A"]]},
541    
542     {"description": "\"a\\\u000D\u000A\"",
543     "input": "\"a\\\u000D\u000A\"",
544     "output": [["STRING", "a\u000D\u000A"]]},
545    
546     {"description": "\"a\\\u000D\\\u000A",
547     "input": "\"a\\\u000D\\\u000A",
548     "output": [["INVALID", "a\u000D\u000A"]]},
549    
550     {"description": "'a\\\u000D\\\u000A",
551     "input": "'a\\\u000D\\\u000A",
552     "output": [["INVALID", "a\u000D\u000A"]]},
553    
554     {"description": "\"a\\\u000D\\\u000A\"",
555     "input": "\"a\\\u000D\\\u000A\"",
556     "output": [["STRING", "a\u000D\u000A"]]},
557    
558     {"description": "\"a\\\u000A",
559     "input": "\"a\\\u000A",
560     "output": [["INVALID", "a\u000A"]]},
561    
562     {"description": "\"a\\\u000A\"",
563     "input": "\"a\\\u000A\"",
564     "output": [["STRING", "a\u000A"]]},
565    
566     {"description": "'a\\\u000A'",
567     "input": "'a\\\u000A'",
568     "output": [["STRING", "a\u000A"]]},
569    
570     {"description": "\"a\\\u000C",
571     "input": "\"a\\\u000C",
572     "output": [["INVALID", "a\u000C"]]},
573    
574     {"description": "\"a\\\u000C\"",
575     "input": "\"a\\\u000C\"",
576     "output": [["STRING", "a\u000C"]]},
577    
578     {"description": "'a\\\u000C'",
579     "input": "'a\\\u000C'",
580     "output": [["STRING", "a\u000C"]]},
581    
582     {"description": "\"a\\\u000Daa",
583     "input": "\"a\\\u000Daa",
584     "output": [["INVALID", "a\u000Daa"]]},
585    
586     {"description": "\"a\\\u000D\u000Ab",
587     "input": "\"a\\\u000D\u000Ab",
588     "output": [["INVALID", "a\u000D\u000Ab"]]},
589    
590     {"description": "'a\\\u000D\u000Ab",
591     "input": "'a\\\u000D\u000Ab",
592 wakaba 1.4 "output": [["INVALID", "a\u000D\u000Ab"]]},
593    
594     {"description": "#",
595     "input": "#",
596     "output": [["DELIM", "#"]]},
597    
598     {"description": "\\#",
599     "input": "\\#",
600     "output": [["IDENT", "#"]]},
601    
602     {"description": "#a",
603     "input": "#a",
604     "output": [["HASH", "a"]]},
605    
606     {"description": "#A",
607     "input": "#A",
608     "output": [["HASH", "A"]]},
609    
610     {"description": "##",
611     "input": "##",
612     "output": [["DELIM", "#"], ["DELIM", "#"]]},
613    
614     {"description": "#\\#",
615     "input": "#\\#",
616     "output": [["HASH", "#"]]},
617    
618     {"description": "#\\X",
619     "input": "#\\X",
620     "output": [["HASH", "X"]]},
621    
622     {"description": "#\\a",
623     "input": "#\\a",
624     "output": [["HASH", "\u000a"]]},
625    
626     {"description": "#\\-",
627     "input": "#\\-",
628     "output": [["HASH", "-"]]},
629    
630     {"description": "#_",
631     "input": "#_",
632     "output": [["HASH", "_"]]},
633    
634     {"description": "#0",
635     "input": "#0",
636     "output": [["HASH", "0"]]},
637    
638     {"description": "#123456",
639     "input": "#123456",
640     "output": [["HASH", "123456"]]},
641    
642     {"description": "#abc",
643     "input": "#abc",
644     "output": [["HASH", "abc"]]},
645    
646     {"description": "#\\4e00XYZ",
647     "input": "#\\4e00XYZ",
648     "output": [["HASH", "\u4e00XYZ"]]},
649    
650     {"description": "#\u4e00",
651     "input": "#\u4e00",
652     "output": [["HASH", "\u4e00"]]},
653    
654     {"description": "#a\\100",
655     "input": "#a\\100",
656     "output": [["HASH", "a\u0100"]]},
657    
658     {"description": "#1234567890",
659     "input": "#1234567890",
660     "output": [["HASH", "1234567890"]]},
661    
662     {"description": "#1a",
663     "input": "#1a",
664     "output": [["HASH", "1a"]]},
665    
666     {"description": "#\\a b",
667     "input": "#\\a b",
668     "output": [["HASH", "\u000ab"]]}
669 wakaba 1.1 ]}

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24