Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-browser-engine

Source of release 0.6.1

0.6.1 / src / web / css / parser / tests_css_rule_parsing_cases.lucb

#==============================================================================================
#
#   tests_css_rule_parsing_cases - the rule, selector, media and syntax parsing 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 on the same inputs (luce-browser-tools,
#       oracles/luce-browser-engine/css_rule_parsing: cases.txt, oracle.cpp, gen_luce_cases.py).
#       tests_css_rule_parsing 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 TestCssRuleParsingCase:
    let mode: str
    let input: str
    let expected: str

## Every oracle case, in cases.txt order.
let test_css_rule_parsing_cases: TestCssRuleParsingCase[279] = [
    TestCssRuleParsingCase(mode = "syntax", input = "*", expected = "  Universal\n  to_string: *\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "  *  ", expected = "  Universal\n  to_string: *\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "* foo", expected = "  none\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "foo", expected = "  Ident: foo\n  to_string: foo\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "foo | bar", expected = "  Alternatives:\n    Ident: foo\n    Ident: bar\n  to_string: foo | bar\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "foo+ | bar# | baz", expected = "  Alternatives:\n    Multiplier:\n      Ident: foo\n    CommaSeparatedMultiplier:\n      Ident: bar\n    Ident: baz\n  to_string: foo+ | bar# | baz\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "\"foo | bar+\"", expected = "  Alternatives:\n    Ident: foo\n    Multiplier:\n      Ident: bar\n  to_string: foo | bar+\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "\"*\"", expected = "  Universal\n  to_string: *\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "foo bar", expected = "  none\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "foo |", expected = "  none\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "| foo", expected = "  none\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "foo || bar", expected = "  none\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "<bogus>", expected = "  none\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "<length", expected = "  none\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "1px", expected = "  none\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "auto | Inherit", expected = "  Alternatives:\n    Ident: auto\n    Ident: Inherit\n  to_string: auto | Inherit\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "\"x\" y", expected = "  none\n"),
    TestCssRuleParsingCase(mode = "syntax", input = "", expected = "  none\n"),
    TestCssRuleParsingCase(mode = "syntaxcustom", input = "foo | bar", expected = "  Alternatives:\n    Ident: foo\n    Ident: bar\n  to_string: foo | bar\n"),
    TestCssRuleParsingCase(mode = "syntaxcustom", input = "inherit", expected = "  none\n"),
    TestCssRuleParsingCase(mode = "syntaxcustom", input = "default", expected = "  none\n"),
    TestCssRuleParsingCase(mode = "syntaxcustom", input = "foo | initial", expected = "  none\n"),
    TestCssRuleParsingCase(mode = "syntaxcustom", input = "\"auto+\"", expected = "  Multiplier:\n    Ident: auto\n  to_string: auto+\n"),
    TestCssRuleParsingCase(mode = "compound", input = "div", expected = "  combinator None\n    TagName ns=0 ns_name='' name='div' lower='div'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "DiV.Foo#Bar", expected = "  combinator None\n    TagName ns=0 ns_name='' name='DiV' lower='div'\n    Class name='Foo' lower='foo'\n    Id name='Bar' lower='bar'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "*.a", expected = "  combinator None\n    Universal ns=0 ns_name='' name='*' lower='*'\n    Class name='a' lower='a'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "svg|rect", expected = "  combinator None\n    TagName ns=3 ns_name='svg' name='rect' lower='rect'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "*|*", expected = "  combinator None\n    Universal ns=2 ns_name='*' name='*' lower='*'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "|p", expected = "  combinator None\n    TagName ns=1 ns_name='' name='p' lower='p'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "html|p", expected = "  error SyntaxError\n  rest: 2\n  error: style selector `html|p` is invalid: Invalid start of a simple selector: Token: Ident(value=\"html\", source=\"html\", start=0:0, end=0:4) (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "*|p.x", expected = "  combinator None\n    TagName ns=2 ns_name='*' name='p' lower='p'\n    Class name='x' lower='x'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ".a.b.c", expected = "  combinator None\n    Class name='a' lower='a'\n    Class name='b' lower='b'\n    Class name='c' lower='c'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "#id", expected = "  combinator None\n    Id name='id' lower='id'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "#1a", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `#1a` is invalid: Hash token is not an id: Token: Hash(value=\"1a\", hash_type=Unrestricted, source=\"#1a\", start=0:0, end=0:3) (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = ".", expected = "  error SyntaxError\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ".1", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `0.1` is invalid: Invalid start of a simple selector: Token: Number(value=0.1, number_type=Number, source=\".1\", start=0:0, end=0:2) (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "&", expected = "  combinator None\n    Nesting\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "&.a", expected = "  combinator None\n    Nesting\n    Class name='a' lower='a'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "a b", expected = "  combinator None\n    TagName ns=0 ns_name='' name='a' lower='a'\n  rest: 2\n"),
    TestCssRuleParsingCase(mode = "compound", input = "a>b", expected = "  combinator None\n    TagName ns=0 ns_name='' name='a' lower='a'\n  rest: 2\n"),
    TestCssRuleParsingCase(mode = "compound", input = "a+b", expected = "  combinator None\n    TagName ns=0 ns_name='' name='a' lower='a'\n  rest: 2\n"),
    TestCssRuleParsingCase(mode = "compound", input = "a~b", expected = "  combinator None\n    TagName ns=0 ns_name='' name='a' lower='a'\n  rest: 2\n"),
    TestCssRuleParsingCase(mode = "compound", input = "a|", expected = "  combinator None\n    TagName ns=0 ns_name='' name='a' lower='a'\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "compound", input = "a!", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `a!` is invalid: Unrecognized delimiter: ! (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "div.a span", expected = "  combinator None\n    TagName ns=0 ns_name='' name='div' lower='div'\n    Class name='a' lower='a'\n  rest: 2\n"),
    TestCssRuleParsingCase(mode = "compound", input = ".a div", expected = "  combinator None\n    Class name='a' lower='a'\n  rest: 2\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x]", expected = "  combinator None\n    Attribute match=0 case=0 ns=0 ns_name='' name='x' lower='x' value=''\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[ x ]", expected = "  combinator None\n    Attribute match=0 case=0 ns=0 ns_name='' name='x' lower='x' value=''\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x=y]", expected = "  combinator None\n    Attribute match=1 case=0 ns=0 ns_name='' name='x' lower='x' value='y'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x=\"y z\"]", expected = "  combinator None\n    Attribute match=1 case=0 ns=0 ns_name='' name='x' lower='x' value='y z'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x~=y]", expected = "  combinator None\n    Attribute match=2 case=0 ns=0 ns_name='' name='x' lower='x' value='y'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x*=y]", expected = "  combinator None\n    Attribute match=3 case=0 ns=0 ns_name='' name='x' lower='x' value='y'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x|=y]", expected = "  combinator None\n    Attribute match=4 case=0 ns=0 ns_name='' name='x' lower='x' value='y'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x^=y]", expected = "  combinator None\n    Attribute match=5 case=0 ns=0 ns_name='' name='x' lower='x' value='y'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x$=y]", expected = "  combinator None\n    Attribute match=6 case=0 ns=0 ns_name='' name='x' lower='x' value='y'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x=y i]", expected = "  combinator None\n    Attribute match=1 case=2 ns=0 ns_name='' name='x' lower='x' value='y'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x=y S]", expected = "  combinator None\n    Attribute match=1 case=1 ns=0 ns_name='' name='x' lower='x' value='y'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[svg|x=y]", expected = "  combinator None\n    Attribute match=1 case=0 ns=3 ns_name='svg' name='x' lower='x' value='y'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[*|x]", expected = "  combinator None\n    Attribute match=0 case=0 ns=2 ns_name='*' name='x' lower='x' value=''\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[|x]", expected = "  combinator None\n    Attribute match=0 case=0 ns=1 ns_name='' name='x' lower='x' value=''\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[]", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `[]` is invalid: Attribute selector is empty. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[*]", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `[*]` is invalid: Expected qualified-name, got: 'Token: Delim(value=\"*\", code_point=U+002A, source=\"*\", start=0:1, end=0:2)'. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[1]", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `[1]` is invalid: Expected qualified-name, got: 'Token: Number(value=1, number_type=Integer, source=\"1\", start=0:1, end=0:2)'. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x=]", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `[x=]` is invalid: Attribute selector ended without a value to match. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x~]", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `[x~]` is invalid: Attribute selector ended part way through a match type. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x!=y]", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `[x!=y]` is invalid: Invalid attribute selector match type `!=` (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x~~y]", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `[x~~y]` is invalid: Expected a double delim for attribute comparison, got: 'Token: Delim(value=\"~\", code_point=U+007E, source=\"~\", start=0:2, end=0:3)Token: Delim(value=\"~\", code_point=U+007E, source=\"~\", start=0:3, end=0:4)'. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x=1]", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `[x=1]` is invalid: Expected a string or ident for the value to match attribute against, got: 'Token: Number(value=1, number_type=Integer, source=\"1\", start=0:3, end=0:4)'. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x=y z]", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `[x=y z]` is invalid: Expected a \"i\" or \"s\" attribute selector case sensitivity identifier, got: 'Token: Ident(value=\"z\", source=\"z\", start=0:5, end=0:6)'. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x=y 1]", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `[x=y 1]` is invalid: Expected an attribute selector case sensitivity identifier, got: 'Token: Number(value=1, number_type=Integer, source=\"1\", start=0:5, end=0:6)' (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x=y i j]", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `[x=y i j]` is invalid: Trailing tokens in attribute selector. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "[x 1]", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `[x 1]` is invalid: Expected delim for attribute comparison, got: 'Token: Number(value=1, number_type=Integer, source=\"1\", start=0:3, end=0:4)'. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":hover", expected = "  combinator None\n    PseudoClass hover anb=0,0 forgiving=0 args=0 langs=[] ident=- levels=[]\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":HOVER", expected = "  combinator None\n    PseudoClass hover anb=0,0 forgiving=0 args=0 langs=[] ident=- levels=[]\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "a:hover:focus", expected = "  combinator None\n    TagName ns=0 ns_name='' name='a' lower='a'\n    PseudoClass hover anb=0,0 forgiving=0 args=0 langs=[] ident=- levels=[]\n    PseudoClass focus anb=0,0 forgiving=0 args=0 langs=[] ident=- levels=[]\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":root.x", expected = "  combinator None\n    PseudoClass root anb=0,0 forgiving=0 args=0 langs=[] ident=- levels=[]\n    Class name='x' lower='x'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":foo", expected = "  error SyntaxError\n  rest: 0\n  error: Unknown pseudo class or element ':foo' in style selector. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":-webkit-foo", expected = "  error IncludesIgnoredVendorPrefix\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":-moz-foo", expected = "  error IncludesIgnoredVendorPrefix\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ": hover", expected = "  error SyntaxError\n  rest: 2\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":", expected = "  error SyntaxError\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":nth-child(2n+1)", expected = "  combinator None\n    PseudoClass nth-child anb=2,1 forgiving=0 args=0 langs=[] ident=- levels=[]\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":nth-child(odd)", expected = "  combinator None\n    PseudoClass nth-child anb=2,1 forgiving=0 args=0 langs=[] ident=- levels=[]\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":nth-child( even )", expected = "  combinator None\n    PseudoClass nth-child anb=2,0 forgiving=0 args=0 langs=[] ident=- levels=[]\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":nth-of-type(3)", expected = "  combinator None\n    PseudoClass nth-of-type anb=0,3 forgiving=0 args=0 langs=[] ident=- levels=[]\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":nth-last-child(-n+3)", expected = "  combinator None\n    PseudoClass nth-last-child anb=-1,3 forgiving=0 args=0 langs=[] ident=- levels=[]\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":nth-child(foo)", expected = "  error SyntaxError\n  rest: 0\n  error: Pseudo ':nth-child' value `foo` is invalid: Invalid An+B format. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":nth-of-type(2n of a)", expected = "  error SyntaxError\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":nth-child(2n+1 bar)", expected = "  error SyntaxError\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":nth-child()", expected = "  error SyntaxError\n  rest: 0\n  error: Pseudo ':nth-child' value `nth-child` is invalid: Missing arguments. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":lang(en)", expected = "  combinator None\n    PseudoClass lang anb=0,0 forgiving=0 args=0 langs=[en] ident=- levels=[]\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":lang(en, \"fr-CA\", de-*)", expected = "  error SyntaxError\n  rest: 0\n  error: Pseudo ':lang' value `lang` is invalid: Failed to parse argument as a language range: Has trailing tokens. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":lang(1)", expected = "  error SyntaxError\n  rest: 0\n  error: Pseudo ':lang' value `lang` is invalid: Failed to parse argument as a language range: Not a string/ident. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":lang(en fr)", expected = "  error SyntaxError\n  rest: 0\n  error: Pseudo ':lang' value `lang` is invalid: Failed to parse argument as a language range: Has trailing tokens. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":dir(ltr)", expected = "  combinator None\n    PseudoClass dir anb=0,0 forgiving=0 args=0 langs=[] ident=ltr/ltr levels=[]\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":dir(rtl)", expected = "  combinator None\n    PseudoClass dir anb=0,0 forgiving=0 args=0 langs=[] ident=rtl/rtl levels=[]\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":dir(Sideways)", expected = "  combinator None\n    PseudoClass dir anb=0,0 forgiving=0 args=0 langs=[] ident=(invalid CSS::Keyword)/Sideways levels=[]\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":dir(ltr x)", expected = "  error SyntaxError\n  rest: 0\n  error: Pseudo ':dir' value `dir` is invalid: Failed to parse argument as an ident. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":dir(1)", expected = "  error SyntaxError\n  rest: 0\n  error: Pseudo ':dir' value `dir` is invalid: Failed to parse argument as an ident. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":heading(1, 2,3)", expected = "  combinator None\n    PseudoClass heading anb=0,0 forgiving=0 args=0 langs=[] ident=- levels=[1,2,3,]\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":heading(1.5)", expected = "  error SyntaxError\n  rest: 0\n  error: Pseudo ':heading' value `heading` is invalid: Failed to parse argument as a <level>: Not an <integer> literal. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":heading(1 2)", expected = "  error SyntaxError\n  rest: 0\n  error: Pseudo ':heading' value `heading` is invalid: Failed to parse argument as a <level>: Has trailing tokens. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":hover(x)", expected = "  error SyntaxError\n  rest: 0\n  error: Pseudo ':hover' value `hover` is invalid: Not valid as a function. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":nth-child", expected = "  error SyntaxError\n  rest: 0\n  error: Pseudo ':nth-child' value `nth-child` is invalid: Only valid as a function. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":bogus(x)", expected = "  error SyntaxError\n  rest: 0\n  error: Unknown pseudo class or element ':bogus' in style selector. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = ":is()", expected = "  error SyntaxError\n  rest: 0\n  error: Pseudo ':is' value `is` is invalid: Missing arguments. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "::-webkit-thing(x)", expected = "  error IncludesIgnoredVendorPrefix\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "::bogus", expected = "  error SyntaxError\n  rest: 0\n  error: Unknown pseudo class or element '::bogus' in style selector. (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "::-moz-bogus", expected = "  error IncludesIgnoredVendorPrefix\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "compound", input = "::1", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `1` is invalid: Pseudo-element should be an ident or function, got: 'Token: Number(value=1, number_type=Integer, source=\"1\", start=0:2, end=0:3)' (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "\"x\"", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `\"x\"` is invalid: Invalid start of a simple selector: Token: String(value=\"x\", source=\"\\\"x\\\"\", start=0:0, end=0:3) (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "1px", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `1px` is invalid: Invalid start of a simple selector: Token: Dimension(value=1, number_type=Integer, unit=\"px\", source=\"1px\", start=0:0, end=0:3) (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "{}", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `{}` is invalid: Invalid start of a simple selector: Block: {} (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "(a)", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `(a)` is invalid: Invalid start of a simple selector: Block: (a) (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "f(x)", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `f(x)` is invalid: Invalid start of a simple selector: Function: f(x) (1)\n"),
    TestCssRuleParsingCase(mode = "compound", input = "a,b", expected = "  combinator None\n    TagName ns=0 ns_name='' name='a' lower='a'\n  rest: 2\n"),
    TestCssRuleParsingCase(mode = "compound", input = "@x", expected = "  error SyntaxError\n  rest: 0\n  error: style selector `@x` is invalid: Invalid start of a simple selector: Token: AtKeyword(value=\"x\", source=\"@x\", start=0:0, end=0:2) (1)\n"),
    TestCssRuleParsingCase(mode = "anb", input = "odd", expected = "  2 1\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "EVEN", expected = "  2 0\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "3", expected = "  0 3\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "-3", expected = "  0 -3\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "+3", expected = "  0 3\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "n", expected = "  1 0\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "N", expected = "  1 0\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "+n", expected = "  1 0\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "-n", expected = "  -1 0\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "2n", expected = "  2 0\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "2N", expected = "  2 0\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "-2n", expected = "  -2 0\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "2n+1", expected = "  2 1\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "2n + 1", expected = "  2 1\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "2n- 1", expected = "  none\n  rest: 3\n"),
    TestCssRuleParsingCase(mode = "anb", input = "2n -1", expected = "  2 -1\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "2n +1", expected = "  2 1\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "2n + +1", expected = "  2 0\n  rest: 3\n"),
    TestCssRuleParsingCase(mode = "anb", input = "2n - -1", expected = "  2 0\n  rest: 3\n"),
    TestCssRuleParsingCase(mode = "anb", input = "2n- -1", expected = "  none\n  rest: 3\n"),
    TestCssRuleParsingCase(mode = "anb", input = "2n-", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "anb", input = "2n- 3", expected = "  none\n  rest: 3\n"),
    TestCssRuleParsingCase(mode = "anb", input = "2n-3", expected = "  2 -3\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "2n-3a", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "anb", input = "-n+3", expected = "  -1 3\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "-n + 3", expected = "  -1 3\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "-n- 3", expected = "  -1 -3\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "-n-3", expected = "  -1 -3\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "-n-", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "anb", input = "n-1", expected = "  1 -1\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "n- 1", expected = "  1 -1\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "+n-1", expected = "  1 -1\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "n -1", expected = "  1 -1\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "n + 1", expected = "  1 1\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "+ n", expected = "  none\n  rest: 3\n"),
    TestCssRuleParsingCase(mode = "anb", input = "n+", expected = "  1 0\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "anb", input = "foo", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "anb", input = "1.5", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "anb", input = "1.5n", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "anb", input = "n 2", expected = "  1 0\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "anb", input = "2n 2", expected = "  2 0\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "anb", input = "  3  ", expected = "  0 3\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "anb", input = "", expected = "  none\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "-N-5", expected = "  -1 -5\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "anb", input = "3 n", expected = "  0 3\n  rest: 2\n"),
    TestCssRuleParsingCase(mode = "combinator", input = ">b", expected = "  ImmediateChild\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "combinator", input = " > b", expected = "  ImmediateChild\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "combinator", input = "+b", expected = "  NextSibling\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "combinator", input = "~b", expected = "  SubsequentSibling\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "combinator", input = "||b", expected = "  Column\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "combinator", input = " || b", expected = "  Column\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "combinator", input = "|b", expected = "  none\n  rest: 2\n"),
    TestCssRuleParsingCase(mode = "combinator", input = " b", expected = "  Descendant\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "combinator", input = "b", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "combinator", input = "  ", expected = "  Descendant\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "combinator", input = "/b", expected = "  none\n  rest: 2\n"),
    TestCssRuleParsingCase(mode = "qname", input = "a", expected = "  ns=0 ns_name='' name='a' lower='a'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "qname", input = "*", expected = "  ns=0 ns_name='' name='*' lower='*'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "qname", input = "svg|a", expected = "  ns=3 ns_name='svg' name='a' lower='a'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "qname", input = "svg|*", expected = "  ns=3 ns_name='svg' name='*' lower='*'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "qname", input = "*|a", expected = "  ns=2 ns_name='*' name='a' lower='a'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "qname", input = "*|*", expected = "  ns=2 ns_name='*' name='*' lower='*'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "qname", input = "|a", expected = "  ns=1 ns_name='' name='a' lower='a'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "qname", input = "|*", expected = "  ns=1 ns_name='' name='*' lower='*'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "qname", input = "html|a", expected = "  none\n  rest: 3\n"),
    TestCssRuleParsingCase(mode = "qname", input = "a |b", expected = "  ns=0 ns_name='' name='a' lower='a'\n  rest: 3\n"),
    TestCssRuleParsingCase(mode = "qname", input = "a| b", expected = "  ns=0 ns_name='' name='a' lower='a'\n  rest: 3\n"),
    TestCssRuleParsingCase(mode = "qname", input = "|", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "qname", input = "1", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "qnamenowild", input = "*", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "qnamenowild", input = "svg|*", expected = "  none\n  rest: 3\n"),
    TestCssRuleParsingCase(mode = "qnamenowild", input = "|*", expected = "  none\n  rest: 2\n"),
    TestCssRuleParsingCase(mode = "qnamenowild", input = "*|a", expected = "  ns=2 ns_name='*' name='a' lower='a'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "qnamenowild", input = "a", expected = "  ns=0 ns_name='' name='a' lower='a'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "complexerr", input = "> a", expected = "  error SyntaxError\n  error: style selector `> a` is invalid: Standalone selector starts with a combinator, which is invalid. (1)\n"),
    TestCssRuleParsingCase(mode = "complexerr", input = "+ a", expected = "  error SyntaxError\n  error: style selector `+ a` is invalid: Standalone selector starts with a combinator, which is invalid. (1)\n"),
    TestCssRuleParsingCase(mode = "complexerr", input = "a >", expected = "  error SyntaxError\n  error: style selector `a >` is invalid: Compound-selector is empty. (1)\n"),
    TestCssRuleParsingCase(mode = "complexerr", input = "a > > b", expected = "  error SyntaxError\n  error: style selector `a > > b` is invalid: Compound-selector is empty. (1)\n"),
    TestCssRuleParsingCase(mode = "complexerr", input = "a ,", expected = "  error SyntaxError\n  error: style selector `a ,` is invalid: Compound-selector is empty. (1)\n"),
    TestCssRuleParsingCase(mode = "complexerr", input = "!", expected = "  error SyntaxError\n  error: style selector `!` is invalid: Unrecognized delimiter: ! (1)\n"),
    TestCssRuleParsingCase(mode = "complexerr", input = "a !", expected = "  error SyntaxError\n  error: style selector `a !` is invalid: Unrecognized delimiter: ! (1)\n"),
    TestCssRuleParsingCase(mode = "relativeerr", input = "> !", expected = "  error SyntaxError\n  error: style selector `> !` is invalid: Unrecognized delimiter: ! (1)\n"),
    TestCssRuleParsingCase(mode = "relativeerr", input = "!", expected = "  error SyntaxError\n  error: style selector `!` is invalid: Unrecognized delimiter: ! (1)\n"),
    TestCssRuleParsingCase(mode = "relativeerr", input = "+", expected = "  error SyntaxError\n  error: style selector `+` is invalid: Failed to parse first compound-selector. (1)\n"),
    TestCssRuleParsingCase(mode = "pageerr", input = ":1", expected = "  error SyntaxError\n  error: @page selector `:1` is invalid: Pseudo-classes must be idents. (1)\n"),
    TestCssRuleParsingCase(mode = "pageerr", input = "\"x\"", expected = "  error SyntaxError\n  error: @page selector `\"x\"` is invalid: Is empty. (1)\n"),
    TestCssRuleParsingCase(mode = "mediatype", input = "layer", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "mediatype", input = "NOT", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "mediatype", input = "and", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "mediatype", input = "only", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "mediatype", input = "or", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "mediatype", input = "1px", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "mediatype", input = "(x)", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "mediatype", input = "", expected = "  none\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "layername", input = "foo", expected = "  'foo'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "layername", input = "foo.bar.baz", expected = "  'foo.bar.baz'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "layername", input = " foo . bar", expected = "  'foo'\n  rest: 4\n"),
    TestCssRuleParsingCase(mode = "layername", input = "foo.bar baz", expected = "  'foo.bar'\n  rest: 2\n"),
    TestCssRuleParsingCase(mode = "layername", input = "foo.", expected = "  none\n  rest: 2\n"),
    TestCssRuleParsingCase(mode = "layername", input = "foo.1", expected = "  'foo'\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "layername", input = "inherit", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "layername", input = "foo.initial", expected = "  none\n  rest: 3\n"),
    TestCssRuleParsingCase(mode = "layername", input = "1", expected = "  none\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "layername", input = "", expected = "  none\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "layernameblank", input = "", expected = "  ''\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "layernameblank", input = "  ", expected = "  ''\n  rest: 1\n"),
    TestCssRuleParsingCase(mode = "layernameblank", input = "foo", expected = "  'foo'\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "import  url(x) ", expected = "  none\n  error: '@import' rule with prelude ` url(\"x\") ` is invalid: Must be a statement, not a block. (1)\n"),
    TestCssRuleParsingCase(mode = "atrule", input = "import ", expected = "  none\n  error: '@import' rule with prelude `` is invalid: Empty prelude. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "import  ", expected = "  none\n  error: '@import' rule with prelude ` ` is invalid: Must be a statement, not a block. (1)\n"),
    TestCssRuleParsingCase(mode = "atrule", input = "keyframes ", expected = "  none\n  error: '@keyframes' rule with prelude `` is invalid: Must be a block, not a statement. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "keyframes  ", expected = "  none\n  error: '@keyframes' rule with prelude ` ` is invalid: Name must be a <string> or <ident>. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "keyframes  1 ", expected = "  none\n  error: '@keyframes' rule with prelude ` 1 ` is invalid: Name must be a <string> or <ident>. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "keyframes  a b ", expected = "  none\n  error: '@keyframes' rule with prelude ` a b ` is invalid: Trailing tokens after name in prelude. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "keyframes  none ", expected = "  none\n  error: '@keyframes' rule with prelude ` none ` is invalid: Invalid name. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "keyframes  inherit ", expected = "  none\n  error: '@keyframes' rule with prelude ` inherit ` is invalid: Invalid name. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "KEYFRAMES  url(x) ", expected = "  none\n  error: '@keyframes' rule with prelude ` url(\"x\") ` is invalid: Name must be a <string> or <ident>. (1)\n"),
    TestCssRuleParsingCase(mode = "atrule", input = "-webkit-keyframes ", expected = "  none\n  error: '@keyframes' rule with prelude `` is invalid: Must be a block, not a statement. (1)\n"),
    TestCssRuleParsingCase(mode = "atrule", input = "container ", expected = "  none\n  error: '@container' rule with prelude `` is invalid: Must be a block, not a statement. (1)\n"),
    TestCssRuleParsingCase(mode = "atrule", input = "counter-style ", expected = "  none\n  error: '@counter-style' rule with prelude `` is invalid: Must be a block, not a statement. (1)\n"),
    TestCssRuleParsingCase(mode = "atrule", input = "font-face ", expected = "  none\n  error: '@font-face' rule with prelude `` is invalid: Must be a block, not a statement. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "font-face  x ", expected = "  none\n  error: '@font-face' rule with prelude ` x ` is invalid: Prelude is not allowed. (1)\n"),
    TestCssRuleParsingCase(mode = "atrule", input = "font-feature-values ", expected = "  none\n  error: '@font-feature-values' rule with prelude `` is invalid: Must be a block, not a statement. (1)\n"),
    TestCssRuleParsingCase(mode = "atrule", input = "function ", expected = "  none\n  error: '@function' rule with prelude `` is invalid: Must be a block, not a statement. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "function  ", expected = "  none\n  error: '@function' rule with prelude ` ` is invalid: Prelude must start with a function token. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "function  foo() ", expected = "  none\n  error: '@function' rule with prelude ` foo() ` is invalid: Function name must start with two dashes. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "function  --foo() bar ", expected = "  none\n  error: '@function' rule with prelude ` --foo() bar ` is invalid: Trailing tokens in prelude. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "function  --foo() returns ", expected = "  none\n  error: '@function' rule with prelude ` --foo() returns ` is invalid: Expected return type after 'returns' in prelude. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "function  --foo() returns 1 ", expected = "  none\n  error: '@function' rule with prelude ` --foo() returns 1 ` is invalid: Expected return type after 'returns' in prelude. (1)\n"),
    TestCssRuleParsingCase(mode = "atrule", input = "layer ", expected = "  none\n  error: '@layer' rule with prelude `` is invalid: No layer names provided. (1)\n"),
    TestCssRuleParsingCase(mode = "atrule", input = "layer  a b", expected = "  none\n  error: '@layer' rule with prelude ` a b` is invalid: Missing comma between layer names. (1)\n"),
    TestCssRuleParsingCase(mode = "atrule", input = "layer  a, b c", expected = "  none\n  error: '@layer' rule with prelude ` a, b c` is invalid: Missing comma between layer names. (1)\n"),
    TestCssRuleParsingCase(mode = "atrule", input = "layer  a,", expected = "  none\n  error: '@layer' rule with prelude ` a,` is invalid: Contains invalid layer name. (1)\n"),
    TestCssRuleParsingCase(mode = "atrule", input = "layer  a, ,b", expected = "  none\n  error: '@layer' rule with prelude ` a, ,b` is invalid: Contains invalid layer name. (1)\n"),
    TestCssRuleParsingCase(mode = "atrule", input = "layer  1", expected = "  none\n  error: '@layer' rule with prelude ` 1` is invalid: Contains invalid layer name. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "layer  a b ", expected = "  none\n  error: '@layer' rule with prelude ` a b ` is invalid: Trailing tokens after name in prelude. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "layer  1 ", expected = "  none\n  error: '@layer' rule with prelude ` 1 ` is invalid: Not a valid layer name. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "layer  inherit ", expected = "  none\n  error: '@layer' rule with prelude ` inherit ` is invalid: Not a valid layer name. (1)\n"),
    TestCssRuleParsingCase(mode = "atblock", input = "-webkit-foo  ", expected = "  none\n"),
    TestCssRuleParsingCase(mode = "atrule", input = "-moz-bar ", expected = "  none\n"),
    TestCssRuleParsingCase(mode = "style", input = "> a ", expected = "  none\n  error: 'style' rule with prelude `> a ` is invalid: Selectors invalid. (1)\n  error: style selector `> a ` is invalid: Standalone selector starts with a combinator, which is invalid. (1)\n"),
    TestCssRuleParsingCase(mode = "style", input = "a > ", expected = "  none\n  error: 'style' rule with prelude `a > ` is invalid: Selectors invalid. (1)\n  error: style selector `a > ` is invalid: Compound-selector is empty. (1)\n"),
    TestCssRuleParsingCase(mode = "style", input = "a ! ", expected = "  none\n  error: style selector `a ! ` is invalid: Unrecognized delimiter: ! (1)\n  error: 'style' rule with prelude `a ! ` is invalid: Selectors invalid. (1)\n"),
    TestCssRuleParsingCase(mode = "style", input = "", expected = "  none\n  error: 'style' rule with prelude `` is invalid: Selectors invalid. (1)\n  error: style selector `` is invalid: Failed to parse first compound-selector. (1)\n"),
    TestCssRuleParsingCase(mode = "style", input = ":foo ", expected = "  none\n  error: Unknown pseudo class or element ':foo' in style selector. (1)\n  error: 'style' rule with prelude `:foo ` is invalid: Selectors invalid. (1)\n"),
    TestCssRuleParsingCase(mode = "style", input = ":-webkit-foo ", expected = "  none\n"),
    TestCssRuleParsingCase(mode = "prelude", input = "--foo()", expected = "  name --foo params 0 returns *\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "prelude", input = "--foo( )", expected = "  name --foo params 0 returns *\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "prelude", input = "  --foo() returns bar", expected = "  name --foo params 0 returns bar\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "prelude", input = "--foo() returns type(*)", expected = "  name --foo params 0 returns *\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "prelude", input = "--foo() returns type( a | b )", expected = "  name --foo params 0 returns a | b\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "prelude", input = "--foo() returns bar+", expected = "  name --foo params 0 returns bar+\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "prelude", input = "--foo() returns bar#", expected = "  name --foo params 0 returns bar#\n  rest: 0\n"),
    TestCssRuleParsingCase(mode = "prelude", input = "--foo() returns", expected = "  none\n  rest: 3\n  error: '@function' rule with prelude `--foo() returns` is invalid: Expected return type after 'returns' in prelude. (1)\n"),
    TestCssRuleParsingCase(mode = "prelude", input = "--foo() returns type()", expected = "  none\n  rest: 5\n  error: '@function' rule with prelude `--foo() returns type()` is invalid: Expected return type after 'returns' in prelude. (1)\n"),
    TestCssRuleParsingCase(mode = "prelude", input = "--foo() returns type(1)", expected = "  none\n  rest: 5\n  error: '@function' rule with prelude `--foo() returns type(1)` is invalid: Expected return type after 'returns' in prelude. (1)\n"),
    TestCssRuleParsingCase(mode = "prelude", input = "--foo() returns bar baz", expected = "  none\n  rest: 7\n  error: '@function' rule with prelude `--foo() returns bar baz` is invalid: Trailing tokens in prelude. (1)\n"),
    TestCssRuleParsingCase(mode = "prelude", input = "--foo() x", expected = "  none\n  rest: 3\n  error: '@function' rule with prelude `--foo() x` is invalid: Trailing tokens in prelude. (1)\n"),
    TestCssRuleParsingCase(mode = "prelude", input = "foo()", expected = "  none\n  rest: 1\n  error: '@function' rule with prelude `foo()` is invalid: Function name must start with two dashes. (1)\n"),
    TestCssRuleParsingCase(mode = "prelude", input = "-foo()", expected = "  none\n  rest: 1\n  error: '@function' rule with prelude `-foo()` is invalid: Function name must start with two dashes. (1)\n"),
    TestCssRuleParsingCase(mode = "prelude", input = "--foo", expected = "  none\n  rest: 1\n  error: '@function' rule with prelude `--foo` is invalid: Prelude must start with a function token. (1)\n"),
    TestCssRuleParsingCase(mode = "prelude", input = "", expected = "  none\n  rest: 0\n  error: '@function' rule with prelude `` is invalid: Prelude must start with a function token. (1)\n"),
]