From 9c0bf11dd144d09c20f16acaf3d40030b4534ec8 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 3 May 2008 10:10:32 +0000 Subject: Fix testdriver to accept # in input Significantly more tests for the lexer -- this basically covers all the non-OOD/EOF cases Fix bug in lexing of "/x" -- the CHAR(/) was getting dropped by the "don't emit comment tokens" logic svn path=/trunk/libcss/; revision=4120 --- test/data/lex/tests1.dat | 608 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 608 insertions(+) (limited to 'test/data/lex') diff --git a/test/data/lex/tests1.dat b/test/data/lex/tests1.dat index 3b6b149..8f7783c 100644 --- a/test/data/lex/tests1.dat +++ b/test/data/lex/tests1.dat @@ -1,3 +1,305 @@ +#data +a +#expected +IDENT:a +S +EOF +#reset + +#data +Z +#expected +IDENT:Z +S +EOF +#reset + +#data +- +#expected +CHAR:- +S +EOF +#reset + +#data +_ +#expected +IDENT:_ +S +EOF +#reset + +#data +@ +#expected +CHAR:@ +S +EOF +#reset + +#data +# +#expected +CHAR:# +S +EOF +#reset + +#data +0 +#expected +NUMBER:0 +S +EOF +#reset + +#data +0.0 +#expected +NUMBER:0.0 +S +EOF +#reset + +#data +.0 +#expected +NUMBER:.0 +S +EOF +#reset + +#data +10% +#expected +PERCENTAGE:10 +S +EOF +#reset + +#data +10.5% +#expected +PERCENTAGE:10.5 +S +EOF +#reset + +#data +.5% +#expected +PERCENTAGE:.5 +S +EOF +#reset + +#data +50px +#expected +DIMENSION:50px +S +EOF +#reset + +#data +50.5px +#expected +DIMENSION:50.5px +S +EOF +#reset + +#data +.4px +#expected +DIMENSION:.4px +S +EOF +#reset + +#data +url() +#expected +URI: +S +EOF +#reset + +#data +url(123456\)); +#expected +URI:123456) +CHAR:; +S +EOF +#reset + +#data +url("123456)"); +#expected +URI:123456) +CHAR:; +S +EOF +#reset + +#data +url('123456)'); +#expected +URI:123456) +CHAR:; +S +EOF +#reset + +#data +U+? +#expected +UNICODE-RANGE:? +S +EOF +#reset + +#data +U+?????1 +#expected +UNICODE-RANGE:?????1 +S +EOF +#reset + +#data +U+ffffff-000000 +#expected +UNICODE-RANGE:ffffff-000000 +S +EOF +#reset + +#data +U+02468ac +#expected +UNICODE-RANGE:02468a +IDENT:c +S +EOF +#reset + +#data +< +#expected +CHAR:< +S +EOF +#reset + +#data + +#expected +CDC +S +EOF +#reset + +#data + +#expected +S +EOF +#reset + +#data +/* *** / *** */ +#expected +S +EOF +#reset + +#data +foo( +#expected +FUNCTION:foo +S +EOF +#reset + +#data +~= +#expected +INCLUDES +S +EOF +#reset + +#data +|= +#expected +DASHMATCH +S +EOF +#reset + +#data +^= +#expected +PREFIXMATCH +S +EOF +#reset + +#data +$= +#expected +SUFFIXMATCH +S +EOF +#reset + +#data +*= +#expected +SUBSTRINGMATCH +S +EOF +#reset + #data body #expected @@ -6,3 +308,309 @@ S EOF #reset +#data +@foo +#expected +ATKEYWORD:foo +S +EOF +#reset + +#data +#blah +#expected +HASH:blah +S +EOF +#reset + +#data +"foo" +#expected +STRING:foo +S +EOF +#reset + +#data +'foo' +#expected +STRING:foo +S +EOF +#reset + +#data +'foo\'' +#expected +STRING:foo' +S +EOF +#reset + +#data +'blah \ + xyz' +#expected +STRING:blah\n xyz +S +EOF +#reset + +#data +url( foo); +#expected +URI:foo +CHAR:; +S +EOF +#reset + +#data +url(foo ); +#expected +URI:foo +CHAR:; +S +EOF +#reset + +#data +url( "foo" ); +#expected +URI:foo +CHAR:; +S +EOF +#reset + +#data +@he\llo +#expected +ATKEYWORD:hello +S +EOF +#reset + +#data +-foo +#expected +IDENT:-foo +S +EOF +#reset + +#data +--x +#expected +CHAR:- +IDENT:-x +S +EOF +#reset + +#data +-\x +#expected +IDENT:-x +S +EOF +#reset + +#data +/x +#expected +CHAR:/ +IDENT:x +S +EOF +#reset + +#data +/***** *** /// ** +#expected +EOF +#reset + +#data +/* */ +/* +*/ +#expected +S +S +EOF +#reset + +#data +\moo +#expected +IDENT:moo +S +EOF +#reset + +#data +~x +#expected +CHAR:~ +IDENT:x +S +EOF +#reset + +#data +. +#expected +CHAR:. +S +EOF +#reset + +#data +0.5\px +#expected +DIMENSION:0.5px +S +EOF +#reset + +#data +@\x +#expected +ATKEYWORD:x +S +EOF +#reset + +#data +0. +#expected +NUMBER:0 +CHAR:. +S +EOF +#reset + +#data +ugh +#expected +IDENT:ugh +S +EOF +#reset + +#data +urx +#expected +IDENT:urx +S +EOF +#reset + +#data +urlx +#expected +IDENT:urlx +S +EOF +#reset + +#data +url(foo +#expected +FUNCTION:url +IDENT:foo +S +EOF +#reset + +#data +url(foo x +#expected +FUNCTION:url +IDENT:foo +S +IDENT:x +S +EOF +#reset + +#data +U+ +#expected +IDENT:U +CHAR:+ +S +EOF +#reset + +#data +U+0-x +#expected +UNICODE-RANGE:0 +IDENT:-x +S +EOF +#reset + +#data +"foo'" +#expected +STRING:foo' +S +EOF +#reset + +#data +'foo"' +#expected +STRING:foo" +S +EOF +#reset + +#data +blah\2022 +#expected +IDENT:blah• +EOF +#reset + +#data +blah\2022x +#expected +IDENT:blah•x +S +EOF +#reset + +#data +blah\2022 f +#expected +IDENT:blah•f +S +EOF +#reset + +#data +\123\456 +#expected +IDENT: +EOF +#reset + +#data +\789\abc +#expected +IDENT: +EOF +#reset + +#data +\def +#expected +IDENT: +EOF +#reset + -- cgit v1.2.3