dymokomi/luce-browser-engine
Source of release 0.6.0
0.6.0 / src / web / css / parser / tests_css_parser_cases.lucb
#==============================================================================================
#
# tests_css_parser_cases - the CSS parser's cases pinned to the reference build
#
# DESCRIPTION:
# Generated (a test vector table) from the output of a local oracle that runs the
# reference Ladybird build's CSS::Parser::Parser on the same inputs (luce-browser-tools,
# oracles/luce-browser-engine/css_parser: cases.txt, oracle.cpp, gen_luce_cases.py).
# tests_css_parser runs each case through the port and compares the dumps.
#
#==============================================================================================
## One oracle case: what to run, on what input, and the reference build's dump.
struct TestCssParserCase:
let mode: str
let input: str
let expected: str
## Every oracle case, in cases.txt order.
let test_css_parser_cases: TestCssParserCase[131] = [
TestCssParserCase(mode = "cv", input = "a {b} (c) f(x)", expected = " Token: Ident(value=\"a\", source=\"a\", start=0:0, end=0:1)\n Token: Whitespace(source=\" \", start=0:1, end=0:2)\n Block: {b}\n Token: Whitespace(source=\" \", start=0:5, end=0:6)\n Block: (c)\n Token: Whitespace(source=\" \", start=0:9, end=0:10)\n Function: f(x)\n = a {b} (c) f(x)\n"),
TestCssParserCase(mode = "cv", input = "foo(bar, baz) [1 2] {x: y}", expected = " Function: foo(bar, baz)\n Token: Whitespace(source=\" \", start=0:13, end=0:14)\n Block: [1 2]\n Token: Whitespace(source=\" \", start=0:19, end=0:20)\n Block: {x: y}\n = foo(bar, baz) [1 2] {x: y}\n"),
TestCssParserCase(mode = "cv", input = "1px+2 -3e2% #fff #-a", expected = " Token: Dimension(value=1, number_type=Integer, unit=\"px\", source=\"1px\", start=0:0, end=0:3)\n Token: Number(value=2, number_type=IntegerWithExplicitSign, source=\"+2\", start=0:3, end=0:5)\n Token: Whitespace(source=\" \", start=0:5, end=0:6)\n Token: Percentage(value=-300, number_type=Number, source=\"-3e2%\", start=0:6, end=0:11)\n Token: Whitespace(source=\" \", start=0:11, end=0:12)\n Token: Hash(value=\"fff\", hash_type=Id, source=\"#fff\", start=0:12, end=0:16)\n Token: Whitespace(source=\" \", start=0:16, end=0:17)\n Token: Hash(value=\"-a\", hash_type=Id, source=\"#-a\", start=0:17, end=0:20)\n = 1px/**/2 -300% #fff #-a\n"),
TestCssParserCase(mode = "cv", input = "a}b", expected = " Token: Ident(value=\"a\", source=\"a\", start=0:0, end=0:1)\n Token: CloseCurly(source=\"}\", start=0:1, end=0:2)\n Token: Ident(value=\"b\", source=\"b\", start=0:2, end=0:3)\n = a}b\n"),
TestCssParserCase(mode = "cv", input = ")]}", expected = " Token: CloseParen(source=\")\", start=0:0, end=0:1)\n Token: CloseSquare(source=\"]\", start=0:1, end=0:2)\n Token: CloseCurly(source=\"}\", start=0:2, end=0:3)\n Token: __EOF__(source=\"\", start=0:3, end=0:3)\n = )]}\n"),
TestCssParserCase(mode = "cv", input = "f(a(b)c", expected = " Function: f(a(b)c)\n = f(a(b)c)\n"),
TestCssParserCase(mode = "cv", input = "[unterminated (", expected = " Block: [unterminated ()]\n = [unterminated ()]\n"),
TestCssParserCase(mode = "cv", input = "url(x.png) url( \"y\" ) bad url(a b)", expected = " Token: Url(value=\"x.png\", source=\"url(x.png)\", start=0:0, end=0:10)\n Token: Whitespace(source=\" \", start=0:10, end=0:11)\n Function: url( \"y\" )\n Token: Whitespace(source=\" \", start=0:21, end=0:22)\n Token: Ident(value=\"bad\", source=\"bad\", start=0:22, end=0:25)\n Token: Whitespace(source=\" \", start=0:25, end=0:26)\n Token: BadUrl(source=\"url(a b)\", start=0:26, end=0:34)\n = url(\"x.png\") url( \"y\" ) bad url()\n"),
TestCssParserCase(mode = "cv", input = "\"str\" 'other' \"bad\nstring\"", expected = " Token: String(value=\"str\", source=\"\\\"str\\\"\", start=0:0, end=0:5)\n Token: Whitespace(source=\" \", start=0:5, end=0:6)\n Token: String(value=\"other\", source=\"'other'\", start=0:6, end=0:13)\n Token: Whitespace(source=\" \", start=0:13, end=0:14)\n Token: BadString(source=\"\\\"bad\", start=0:14, end=0:18)\n Token: Whitespace(source=\"\\n\", start=0:18, end=1:0)\n Token: Ident(value=\"string\", source=\"string\", start=1:0, end=1:6)\n Token: String(value=\"\", source=\"\\\"\", start=1:6, end=1:7)\n = \"str\" \"other\" string\"\"\n"),
TestCssParserCase(mode = "cv", input = "@media .5em 10% -.5 +1 1e3 u+1-2", expected = " Token: AtKeyword(value=\"media\", source=\"@media\", start=0:0, end=0:6)\n Token: Whitespace(source=\" \", start=0:6, end=0:7)\n Token: Dimension(value=0.5, number_type=Number, unit=\"em\", source=\".5em\", start=0:7, end=0:11)\n Token: Whitespace(source=\" \", start=0:11, end=0:12)\n Token: Percentage(value=10, number_type=Integer, source=\"10%\", start=0:12, end=0:15)\n Token: Whitespace(source=\" \", start=0:15, end=0:16)\n Token: Number(value=-0.5, number_type=Number, source=\"-.5\", start=0:16, end=0:19)\n Token: Whitespace(source=\" \", start=0:19, end=0:20)\n Token: Number(value=1, number_type=IntegerWithExplicitSign, source=\"+1\", start=0:20, end=0:22)\n Token: Whitespace(source=\" \", start=0:22, end=0:23)\n Token: Number(value=1000, number_type=Number, source=\"1e3\", start=0:23, end=0:26)\n Token: Whitespace(source=\" \", start=0:26, end=0:27)\n Token: Ident(value=\"u\", source=\"u\", start=0:27, end=0:28)\n Token: Number(value=1, number_type=IntegerWithExplicitSign, source=\"+1\", start=0:28, end=0:30)\n Token: Number(value=-2, number_type=IntegerWithExplicitSign, source=\"-2\", start=0:30, end=0:32)\n = @media 0.5em 10% -0.5 1 1000 u/**/1/**/-2\n"),
TestCssParserCase(mode = "cv", input = "<!-- --> a|b ~= *= ^= $= || :: ; ,", expected = " Token: CDO(source=\"<!--\", start=0:0, end=0:4)\n Token: Whitespace(source=\" \", start=0:4, end=0:5)\n Token: CDC(source=\"-->\", start=0:5, end=0:8)\n Token: Whitespace(source=\" \", start=0:8, end=0:9)\n Token: Ident(value=\"a\", source=\"a\", start=0:9, end=0:10)\n Token: Delim(value=\"|\", code_point=U+007C, source=\"|\", start=0:10, end=0:11)\n Token: Ident(value=\"b\", source=\"b\", start=0:11, end=0:12)\n Token: Whitespace(source=\" \", start=0:12, end=0:13)\n Token: Delim(value=\"~\", code_point=U+007E, source=\"~\", start=0:13, end=0:14)\n Token: Delim(value=\"=\", code_point=U+003D, source=\"=\", start=0:14, end=0:15)\n Token: Whitespace(source=\" \", start=0:15, end=0:16)\n Token: Delim(value=\"*\", code_point=U+002A, source=\"*\", start=0:16, end=0:17)\n Token: Delim(value=\"=\", code_point=U+003D, source=\"=\", start=0:17, end=0:18)\n Token: Whitespace(source=\" \", start=0:18, end=0:19)\n Token: Delim(value=\"^\", code_point=U+005E, source=\"^\", start=0:19, end=0:20)\n Token: Delim(value=\"=\", code_point=U+003D, source=\"=\", start=0:20, end=0:21)\n Token: Whitespace(source=\" \", start=0:21, end=0:22)\n Token: Delim(value=\"$\", code_point=U+0024, source=\"$\", start=0:22, end=0:23)\n Token: Delim(value=\"=\", code_point=U+003D, source=\"=\", start=0:23, end=0:24)\n Token: Whitespace(source=\" \", start=0:24, end=0:25)\n Token: Delim(value=\"|\", code_point=U+007C, source=\"|\", start=0:25, end=0:26)\n Token: Delim(value=\"|\", code_point=U+007C, source=\"|\", start=0:26, end=0:27)\n Token: Whitespace(source=\" \", start=0:27, end=0:28)\n Token: Colon(source=\":\", start=0:28, end=0:29)\n Token: Colon(source=\":\", start=0:29, end=0:30)\n Token: Whitespace(source=\" \", start=0:30, end=0:31)\n Token: Semicolon(source=\";\", start=0:31, end=0:32)\n Token: Whitespace(source=\" \", start=0:32, end=0:33)\n Token: Comma(source=\",\", start=0:33, end=0:34)\n = <!-- --> a|b ~= *= ^= $= || :: ; ,\n"),
TestCssParserCase(mode = "cv", input = "a-b -a --x a1 1a #1 a#b", expected = " Token: Ident(value=\"a-b\", source=\"a-b\", start=0:0, end=0:3)\n Token: Whitespace(source=\" \", start=0:3, end=0:4)\n Token: Ident(value=\"-a\", source=\"-a\", start=0:4, end=0:6)\n Token: Whitespace(source=\" \", start=0:6, end=0:7)\n Token: Ident(value=\"--x\", source=\"--x\", start=0:7, end=0:10)\n Token: Whitespace(source=\" \", start=0:10, end=0:11)\n Token: Ident(value=\"a1\", source=\"a1\", start=0:11, end=0:13)\n Token: Whitespace(source=\" \", start=0:13, end=0:14)\n Token: Dimension(value=1, number_type=Integer, unit=\"a\", source=\"1a\", start=0:14, end=0:16)\n Token: Whitespace(source=\" \", start=0:16, end=0:17)\n Token: Hash(value=\"1\", hash_type=Unrestricted, source=\"#1\", start=0:17, end=0:19)\n Token: Whitespace(source=\" \", start=0:19, end=0:20)\n Token: Ident(value=\"a\", source=\"a\", start=0:20, end=0:21)\n Token: Hash(value=\"b\", hash_type=Id, source=\"#b\", start=0:21, end=0:23)\n = a-b -a --x a1 1a #1 a#b\n"),
TestCssParserCase(mode = "cv", input = "/* comment */ a /**/ b", expected = " Token: Whitespace(source=\"/* comment */\", start=0:0, end=0:13)\n Token: Whitespace(source=\" \", start=0:13, end=0:14)\n Token: Ident(value=\"a\", source=\"a\", start=0:14, end=0:15)\n Token: Whitespace(source=\" \", start=0:15, end=0:16)\n Token: Whitespace(source=\"/**/\", start=0:16, end=0:20)\n Token: Whitespace(source=\" \", start=0:20, end=0:21)\n Token: Ident(value=\"b\", source=\"b\", start=0:21, end=0:22)\n = a b\n"),
TestCssParserCase(mode = "cv", input = "1 2 a b 1a-b a( b-( -1 .1 +.1 @a- #a- 1% %", expected = " Token: Number(value=1, number_type=Integer, source=\"1\", start=0:0, end=0:1)\n Token: Whitespace(source=\" \", start=0:1, end=0:2)\n Token: Number(value=2, number_type=Integer, source=\"2\", start=0:2, end=0:3)\n Token: Whitespace(source=\" \", start=0:3, end=0:4)\n Token: Ident(value=\"a\", source=\"a\", start=0:4, end=0:5)\n Token: Whitespace(source=\" \", start=0:5, end=0:6)\n Token: Ident(value=\"b\", source=\"b\", start=0:6, end=0:7)\n Token: Whitespace(source=\" \", start=0:7, end=0:8)\n Token: Dimension(value=1, number_type=Integer, unit=\"a-b\", source=\"1a-b\", start=0:8, end=0:12)\n Token: Whitespace(source=\" \", start=0:12, end=0:13)\n Function: a( b-( -1 0.1 0.1 @a- #a- 1% %))\n = 1 2 a b 1a-b a( b-( -1 0.1 0.1 @a- #a- 1% %))\n"),
TestCssParserCase(mode = "cv", input = "\\41 b\\ c \\", expected = " Token: Ident(value=\"Ab c\", source=\"\\\\41 b\\\\ c\", start=0:0, end=0:8)\n Token: Whitespace(source=\" \", start=0:8, end=0:9)\n Token: Ident(value=\"�\", source=\"\\\\\", start=0:9, end=0:10)\n = Ab\\ c �\n"),
TestCssParserCase(mode = "cv", input = "", expected = " = \n"),
TestCssParserCase(mode = "one", input = " a ", expected = " Token: Ident(value=\"a\", source=\"a\", start=0:2, end=0:3)\n"),
TestCssParserCase(mode = "one", input = "f(1, 2) ", expected = " Function: f(1, 2)\n"),
TestCssParserCase(mode = "one", input = "{a}", expected = " Block: {a}\n"),
TestCssParserCase(mode = "one", input = "a b", expected = " none\n"),
TestCssParserCase(mode = "one", input = "", expected = " none\n"),
TestCssParserCase(mode = "csv", input = "a, b ,c", expected = " group:\n Token: Ident(value=\"a\", source=\"a\", start=0:0, end=0:1)\n = a\n group:\n Token: Whitespace(source=\" \", start=0:2, end=0:3)\n Token: Ident(value=\"b\", source=\"b\", start=0:3, end=0:4)\n Token: Whitespace(source=\" \", start=0:4, end=0:5)\n = b \n group:\n Token: Ident(value=\"c\", source=\"c\", start=0:6, end=0:7)\n = c\n"),
TestCssParserCase(mode = "csv", input = "a,,b,", expected = " group:\n Token: Ident(value=\"a\", source=\"a\", start=0:0, end=0:1)\n = a\n group:\n = \n group:\n Token: Ident(value=\"b\", source=\"b\", start=0:3, end=0:4)\n = b\n group:\n = \n"),
TestCssParserCase(mode = "csv", input = "f(a, b), [c, d]", expected = " group:\n Function: f(a, b)\n = f(a, b)\n group:\n Token: Whitespace(source=\" \", start=0:8, end=0:9)\n Block: [c, d]\n = [c, d]\n"),
TestCssParserCase(mode = "csv", input = "", expected = ""),
TestCssParserCase(mode = "csv", input = ",", expected = " group:\n = \n group:\n = \n"),
TestCssParserCase(mode = "sheet", input = "a { color: red; }", expected = " qualified prelude:[a ]\n color: [red] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a, b > c { color: red !important; margin : 0 1px ! IMPORTANT ; }", expected = " qualified prelude:[a, b > c ]\n color: [red] important:1 original:-\n margin: [0 1px] important:1 original:-\n"),
TestCssParserCase(mode = "sheet", input = "<!-- a { x: y } --> b {}", expected = " qualified prelude:[a ]\n x: [y] important:0 original:-\n qualified prelude:[b ]\n"),
TestCssParserCase(mode = "sheet", input = "a { color: red; b { color: blue } c: d; }", expected = " qualified prelude:[a ]\n color: [red] important:0 original:-\n qualified prelude:[b ]\n color: [blue] important:0 original:-\n declarations:\n c: [d] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { --x: { y } ; --y: a b ; --: z; }", expected = " qualified prelude:[a ]\n --x: [{ y }] important:0 original:{ y }\n --y: [a b] important:0 original:a b\n"),
TestCssParserCase(mode = "sheet", input = "a { color: {red} x; width: {1px}; }", expected = " qualified prelude:[a ]\n qualified prelude:[color: ]\n declarations:\n width: [{1px}] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { @media screen { b: c } d: e }", expected = " qualified prelude:[a ]\n @media prelude:[ screen ] block:1\n declarations:\n b: [c] important:0 original:-\n declarations:\n d: [e] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { @media x { @container y { z: w } } }", expected = " qualified prelude:[a ]\n @media prelude:[ x ] block:1\n @container prelude:[ y ] block:1\n declarations:\n z: [w] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { @media print; b: c; @foo; }", expected = " qualified prelude:[a ]\n @media prelude:[ print] block:0\n declarations:\n b: [c] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { b: c } }", expected = " qualified prelude:[a ]\n b: [c] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { b: c", expected = " qualified prelude:[a ]\n b: [c] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { --x: 1 } { y }", expected = " qualified prelude:[a ]\n --x: [1] important:0 original:1\n qualified prelude:[]\n"),
TestCssParserCase(mode = "sheet", input = "--x: y { z }", expected = ""),
TestCssParserCase(mode = "sheet", input = "a { b c; d: e; f }", expected = " qualified prelude:[a ]\n d: [e] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { b: !important; c: x ! important; d: x !important !important }", expected = " qualified prelude:[a ]\n b: [!important] important:0 original:-\n c: [x] important:1 original:-\n d: [x !important] important:1 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { e:f(1) ; g: h /* c */ ; }", expected = " qualified prelude:[a ]\n e: [f(1)] important:0 original:-\n g: [h] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a {;;; ;b:c;;}", expected = " qualified prelude:[a ]\n b: [c] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { b:c } d { e:f } ", expected = " qualified prelude:[a ]\n b: [c] important:0 original:-\n qualified prelude:[d ]\n e: [f] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { b: url(x) \"s\" 1px }", expected = " qualified prelude:[a ]\n b: [url(\"x\") \"s\" 1px] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { b { c { d: e } } }", expected = " qualified prelude:[a ]\n qualified prelude:[b ]\n qualified prelude:[c ]\n d: [e] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { b: c; d: e; @media x { f: g } h: i; j: k }", expected = " qualified prelude:[a ]\n b: [c] important:0 original:-\n d: [e] important:0 original:-\n @media prelude:[ x ] block:1\n declarations:\n f: [g] important:0 original:-\n declarations:\n h: [i] important:0 original:-\n j: [k] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { b: c; ;d e { } f: g }", expected = " qualified prelude:[a ]\n b: [c] important:0 original:-\n qualified prelude:[d e ]\n declarations:\n f: [g] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { x:1; y }", expected = " qualified prelude:[a ]\n x: [1] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "{ a: b }", expected = " qualified prelude:[]\n a: [b] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a } b { c: d }", expected = " qualified prelude:[a } b ]\n c: [d] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { unicode-range: U+0-7F; }", expected = " qualified prelude:[a ]\n unicode-range: [U/**/0/**/-7F] important:0 original:-\n"),
TestCssParserCase(mode = "sheet", input = "a { --a-b: [1]; --c:(2) }", expected = " qualified prelude:[a ]\n --a-b: [[1]] important:0 original:[1]\n --c: [(2)] important:0 original:(2)\n"),
TestCssParserCase(mode = "block", input = "color: red; margin: 0", expected = ""),
TestCssParserCase(mode = "style", input = "color: red; margin: 0", expected = " declarations:\n color: [red] important:0 original:-\n margin: [0] important:0 original:-\n"),
TestCssParserCase(mode = "style", input = "color: red !important; --x: { a } ; --y: 1px", expected = " declarations:\n color: [red] important:1 original:-\n --x: [{ a }] important:0 original:{ a }\n --y: [1px] important:0 original:1px\n"),
TestCssParserCase(mode = "style", input = "a b; c: d; e { f: g } h: i", expected = " declarations:\n c: [d] important:0 original:-\n qualified prelude:[e ]\n f: [g] important:0 original:-\n declarations:\n h: [i] important:0 original:-\n"),
TestCssParserCase(mode = "style", input = "@media x { a: b } c: d", expected = " @media prelude:[ x ] block:1\n declarations:\n a: [b] important:0 original:-\n declarations:\n c: [d] important:0 original:-\n"),
TestCssParserCase(mode = "style", input = " ", expected = ""),
TestCssParserCase(mode = "style", input = "x: y; }", expected = " declarations:\n x: [y] important:0 original:-\n"),
TestCssParserCase(mode = "style", input = "--x:a}b", expected = " declarations:\n --x: [a] important:0 original:a\n"),
TestCssParserCase(mode = "style", input = "--: a", expected = ""),
TestCssParserCase(mode = "style", input = "a: b; c", expected = " declarations:\n a: [b] important:0 original:-\n"),
TestCssParserCase(mode = "style", input = "a {} b: c", expected = " qualified prelude:[a ]\n declarations:\n b: [c] important:0 original:-\n"),
TestCssParserCase(mode = "style", input = "a: {} ; b: {c} d", expected = " declarations:\n a: [{}] important:0 original:-\n qualified prelude:[b: ]\n"),
TestCssParserCase(mode = "rule", input = "a { b: c }", expected = " qualified prelude:[a ]\n b: [c] important:0 original:-\n"),
TestCssParserCase(mode = "rule", input = " a { b: c } ", expected = " qualified prelude:[a ]\n b: [c] important:0 original:-\n"),
TestCssParserCase(mode = "rule", input = "a { b: c } d", expected = " none\n"),
TestCssParserCase(mode = "rule", input = "", expected = " none\n"),
TestCssParserCase(mode = "rule", input = "a", expected = " none\n"),
TestCssParserCase(mode = "rule", input = "a { --x: y }", expected = " qualified prelude:[a ]\n --x: [y] important:0 original:y\n"),
TestCssParserCase(mode = "decl", input = "color: red", expected = " color: [red] important:0 original:-\n"),
TestCssParserCase(mode = "decl", input = " color : red !important ", expected = " color: [red] important:1 original:-\n"),
TestCssParserCase(mode = "decl", input = "--x: a b ", expected = " --x: [a b] important:0 original:a b\n"),
TestCssParserCase(mode = "decl", input = "color", expected = " none\n"),
TestCssParserCase(mode = "decl", input = "1: red", expected = " none\n"),
TestCssParserCase(mode = "decl", input = "color: red; more: x", expected = " color: [red] important:0 original:-\n"),
TestCssParserCase(mode = "decl", input = "a: {b}", expected = " a: [{b}] important:0 original:-\n"),
TestCssParserCase(mode = "decl", input = "a: b {c}", expected = " none\n"),
TestCssParserCase(mode = "fulltext", input = "color : red !important", expected = " color : red !important\n"),
TestCssParserCase(mode = "fulltext", input = "--x: a b; c", expected = " --x: a b\n"),
TestCssParserCase(mode = "fulltext", input = "a: f( b ) ", expected = " a: f( b ) \n"),
TestCssParserCase(mode = "vendor", input = "color", expected = " false\n"),
TestCssParserCase(mode = "vendor", input = "-webkit-box", expected = " true\n"),
TestCssParserCase(mode = "vendor", input = "--custom", expected = " false\n"),
TestCssParserCase(mode = "vendor", input = "-libweb-thing", expected = " false\n"),
TestCssParserCase(mode = "vendor", input = "-foo", expected = " false\n"),
TestCssParserCase(mode = "vendor", input = "-", expected = " false\n"),
TestCssParserCase(mode = "vendor", input = "-x-y-z", expected = " true\n"),
TestCssParserCase(mode = "ident", input = "foo", expected = " true\n"),
TestCssParserCase(mode = "ident", input = "inherit", expected = " false\n"),
TestCssParserCase(mode = "ident", input = "INITIAL", expected = " false\n"),
TestCssParserCase(mode = "ident", input = "unset", expected = " false\n"),
TestCssParserCase(mode = "ident", input = "revert", expected = " false\n"),
TestCssParserCase(mode = "ident", input = "revert-layer", expected = " false\n"),
TestCssParserCase(mode = "ident", input = "default", expected = " false\n"),
TestCssParserCase(mode = "ident", input = "DeFault", expected = " false\n"),
TestCssParserCase(mode = "ident", input = "auto", expected = " false\n"),
TestCssParserCase(mode = "ident", input = "NONE", expected = " false\n"),
TestCssParserCase(mode = "ident", input = "nonee", expected = " true\n"),
TestCssParserCase(mode = "decldecl", input = "color", expected = " color: red ;\n color: !important;\n"),
TestCssParserCase(mode = "decldecl", input = "--my-prop", expected = " --my-prop: red ;\n --my-prop: !important;\n"),
TestCssParserCase(mode = "decldecl", input = "1a", expected = " \\31 a: red ;\n \\31 a: !important;\n"),
TestCssParserCase(mode = "decldecl", input = "a b", expected = " a\\ b: red ;\n a\\ b: !important;\n"),
TestCssParserCase(mode = "decode", input = "a { b: c }", expected = " a { b: c }\n"),
TestCssParserCase(mode = "decode", input = "@charset \"utf-8\"; a {}", expected = " @charset \"utf-8\"; a {}\n"),
TestCssParserCase(mode = "decode", input = "@charset \"iso-8859-2\"; a {}", expected = " @charset \"iso-8859-2\"; a {}\n"),
TestCssParserCase(mode = "decode", input = "@charset \"UTF-16BE\"; a {}", expected = " @charset \"UTF-16BE\"; a {}\n"),
TestCssParserCase(mode = "decode", input = "@charset \"bogus\"; a {}", expected = " @charset \"bogus\"; a {}\n"),
TestCssParserCase(mode = "decode", input = "@charset 'utf-8'; a {}", expected = " @charset 'utf-8'; a {}\n"),
TestCssParserCase(mode = "decode", input = "@charset \"x", expected = " @charset \"x\n"),
TestCssParserCase(mode = "atctx", input = "media", expected = " 4\n"),
TestCssParserCase(mode = "atctx", input = "MeDiA", expected = " 4\n"),
TestCssParserCase(mode = "atctx", input = "container", expected = " 2\n"),
TestCssParserCase(mode = "atctx", input = "counter-style", expected = " 3\n"),
TestCssParserCase(mode = "atctx", input = "font-face", expected = " 5\n"),
TestCssParserCase(mode = "atctx", input = "keyframes", expected = " 9\n"),
TestCssParserCase(mode = "atctx", input = "-WEBKIT-keyframes", expected = " 9\n"),
TestCssParserCase(mode = "atctx", input = "font-feature-values", expected = " 6\n"),
TestCssParserCase(mode = "atctx", input = "function", expected = " 8\n"),
TestCssParserCase(mode = "errors", input = "foo", expected = " Unknown property 'foo' in style rule. 1533009893\n Unknown rule 'foo'. 596015325\n Unknown media feature 'foo'. 596015325\n Unknown pseudo class or element 'foo' in style selector. 1533009893\n Property 'foo' in style rule has invalid value `foo`. 678408216\n Unable to parse foo from `foo`: desc 4100412113\n 'foo' rule with prelude `foo` is invalid: desc 4100412113\n '@media' query `foo` is invalid: desc 2326993833\n style selector `foo` is invalid: desc 3245717461\n Pseudo 'foo' value `foo` is invalid: desc 4100412113\n '@inner' rule is invalid inside foo 2200082966\n"),
TestCssParserCase(mode = "errors", input = "--very-long-property-name", expected = " Unknown property '--very-long-property-name' in style rule. 2958661350\n Unknown rule '--very-long-property-name'. 1403431146\n Unknown media feature '--very-long-property-name'. 1403431146\n Unknown pseudo class or element '--very-long-property-name' in style selector. 2958661350\n Property '--very-long-property-name' in style rule has invalid value `--very-long-property-name`. 2967521318\n Unable to parse --very-long-property-name from `--very-long-property-name`: desc 3729903561\n '--very-long-property-name' rule with prelude `--very-long-property-name` is invalid: desc 3729903561\n '@media' query `--very-long-property-name` is invalid: desc 158489689\n style selector `--very-long-property-name` is invalid: desc 2374164425\n Pseudo '--very-long-property-name' value `--very-long-property-name` is invalid: desc 3729903561\n '@inner' rule is invalid inside --very-long-property-name 3805925766\n"),
TestCssParserCase(mode = "math", input = "abs()", expected = " none\n Unable to parse abs() from ``: Wrong number of arguments 0, expected between 1 and 1 inclusive. (1)\n"),
TestCssParserCase(mode = "math", input = "ABS()", expected = " none\n Unable to parse abs() from ``: Wrong number of arguments 0, expected between 1 and 1 inclusive. (1)\n"),
TestCssParserCase(mode = "math", input = "sign(1, 2)", expected = " none\n Unable to parse sign() from `1, 2`: Wrong number of arguments 2, expected between 1 and 1 inclusive. (1)\n"),
TestCssParserCase(mode = "math", input = "clamp(1, 2)", expected = " none\n Unable to parse clamp() from `1, 2`: Wrong number of arguments 2, expected between 3 and 3 inclusive. (1)\n"),
TestCssParserCase(mode = "math", input = "round(a, b, c, d)", expected = " none\n Unable to parse round() from `a, b, c, d`: Wrong number of arguments 4, expected between 2 and 3 inclusive. (1)\n"),
TestCssParserCase(mode = "math", input = "log()", expected = " none\n Unable to parse log() from ``: Wrong number of arguments 0, expected between 1 and 2 inclusive. (1)\n"),
TestCssParserCase(mode = "math", input = "pow(1, 2, 3)", expected = " none\n Unable to parse pow() from `1, 2, 3`: Wrong number of arguments 3, expected between 2 and 2 inclusive. (1)\n"),
TestCssParserCase(mode = "math", input = "foo(1)", expected = " none\n"),
TestCssParserCase(mode = "math", input = "calc(1)", expected = " none\n"),
]