From b70636a2aff7dee4001f2290030f51fa7f6afb1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Tue, 21 Mar 2023 11:40:17 +0900 Subject: [PATCH] Update test refs --- .../tests/fixture/turbo/4092/output.json | 425 +++++++++++++++++ .../tests/fixture/turbo/4092/span.swc-stderr | 450 ++++++++++++++++++ 2 files changed, 875 insertions(+) create mode 100644 crates/swc_css_parser/tests/fixture/turbo/4092/output.json create mode 100644 crates/swc_css_parser/tests/fixture/turbo/4092/span.swc-stderr diff --git a/crates/swc_css_parser/tests/fixture/turbo/4092/output.json b/crates/swc_css_parser/tests/fixture/turbo/4092/output.json new file mode 100644 index 000000000000..18cee09212c5 --- /dev/null +++ b/crates/swc_css_parser/tests/fixture/turbo/4092/output.json @@ -0,0 +1,425 @@ +{ + "type": "Stylesheet", + "span": { + "start": 1, + "end": 128, + "ctxt": 0 + }, + "rules": [ + { + "type": "QualifiedRule", + "span": { + "start": 1, + "end": 128, + "ctxt": 0 + }, + "prelude": { + "type": "SelectorList", + "span": { + "start": 1, + "end": 74, + "ctxt": 0 + }, + "children": [ + { + "type": "ComplexSelector", + "span": { + "start": 1, + "end": 38, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 1, + "end": 10, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 1, + "end": 10, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 2, + "end": 10, + "ctxt": 0 + }, + "value": "carousel", + "raw": "carousel" + } + } + ] + }, + { + "type": "Combinator", + "span": { + "start": 10, + "end": 11, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 11, + "end": 24, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 11, + "end": 24, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 12, + "end": 24, + "ctxt": 0 + }, + "value": "control-dots", + "raw": "control-dots" + } + } + ] + }, + { + "type": "Combinator", + "span": { + "start": 24, + "end": 25, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 25, + "end": 38, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 25, + "end": 29, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 26, + "end": 29, + "ctxt": 0 + }, + "value": "dot", + "raw": "dot" + } + }, + { + "type": "ClassSelector", + "span": { + "start": 29, + "end": 38, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 30, + "end": 38, + "ctxt": 0 + }, + "value": "selected", + "raw": "selected" + } + } + ] + } + ] + }, + { + "type": "ComplexSelector", + "span": { + "start": 40, + "end": 74, + "ctxt": 0 + }, + "children": [ + { + "type": "CompoundSelector", + "span": { + "start": 40, + "end": 49, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 40, + "end": 49, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 41, + "end": 49, + "ctxt": 0 + }, + "value": "carousel", + "raw": "carousel" + } + } + ] + }, + { + "type": "Combinator", + "span": { + "start": 49, + "end": 50, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 50, + "end": 63, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 50, + "end": 63, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 51, + "end": 63, + "ctxt": 0 + }, + "value": "control-dots", + "raw": "control-dots" + } + } + ] + }, + { + "type": "Combinator", + "span": { + "start": 63, + "end": 64, + "ctxt": 0 + }, + "value": " " + }, + { + "type": "CompoundSelector", + "span": { + "start": 64, + "end": 74, + "ctxt": 0 + }, + "nestingSelector": null, + "typeSelector": null, + "subclassSelectors": [ + { + "type": "ClassSelector", + "span": { + "start": 64, + "end": 68, + "ctxt": 0 + }, + "text": { + "type": "Ident", + "span": { + "start": 65, + "end": 68, + "ctxt": 0 + }, + "value": "dot", + "raw": "dot" + } + }, + { + "type": "PseudoClassSelector", + "span": { + "start": 68, + "end": 74, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 69, + "end": 74, + "ctxt": 0 + }, + "value": "hover", + "raw": "hover" + }, + "children": null + } + ] + } + ] + } + ] + }, + "block": { + "type": "SimpleBlock", + "span": { + "start": 75, + "end": 128, + "ctxt": 0 + }, + "name": { + "type": "PreservedToken", + "span": { + "start": 75, + "end": 76, + "ctxt": 0 + }, + "token": "LBrace" + }, + "value": [ + { + "type": "Declaration", + "span": { + "start": 82, + "end": 92, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 82, + "end": 89, + "ctxt": 0 + }, + "value": "opacity", + "raw": "opacity" + }, + "value": [ + { + "type": "Integer", + "span": { + "start": 91, + "end": 92, + "ctxt": 0 + }, + "value": 1, + "raw": "1" + } + ], + "important": null + }, + { + "type": "Declaration", + "span": { + "start": 99, + "end": 125, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 99, + "end": 105, + "ctxt": 0 + }, + "value": "filter", + "raw": "filter" + }, + "value": [ + { + "type": "Function", + "span": { + "start": 107, + "end": 125, + "ctxt": 0 + }, + "name": { + "type": "Ident", + "span": { + "start": 107, + "end": 112, + "ctxt": 0 + }, + "value": "alpha", + "raw": "alpha" + }, + "value": [ + { + "type": "Ident", + "span": { + "start": 113, + "end": 120, + "ctxt": 0 + }, + "value": "opacity", + "raw": "opacity" + }, + { + "type": "PreservedToken", + "span": { + "start": 120, + "end": 121, + "ctxt": 0 + }, + "token": { + "Delim": { + "value": "=" + } + } + }, + { + "type": "Integer", + "span": { + "start": 121, + "end": 124, + "ctxt": 0 + }, + "value": 100, + "raw": "100" + } + ] + } + ], + "important": null + } + ] + } + } + ] +} diff --git a/crates/swc_css_parser/tests/fixture/turbo/4092/span.swc-stderr b/crates/swc_css_parser/tests/fixture/turbo/4092/span.swc-stderr new file mode 100644 index 000000000000..0f2043c48853 --- /dev/null +++ b/crates/swc_css_parser/tests/fixture/turbo/4092/span.swc-stderr @@ -0,0 +1,450 @@ + + x Stylesheet + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | ,-> .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + 2 | | opacity: 1; + 3 | | filter: alpha(opacity=100); + 4 | `-> } + `---- + + x Rule + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | ,-> .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + 2 | | opacity: 1; + 3 | | filter: alpha(opacity=100); + 4 | `-> } + `---- + + x QualifiedRule + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | ,-> .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + 2 | | opacity: 1; + 3 | | filter: alpha(opacity=100); + 4 | `-> } + `---- + + x SelectorList + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + 2 | opacity: 1; + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + 2 | opacity: 1; + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^ + 2 | opacity: 1; + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^ + 2 | opacity: 1; + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^ + 2 | opacity: 1; + `---- + + x Ident + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^ + 2 | opacity: 1; + `---- + + x Combinator + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^ + 2 | opacity: 1; + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^^^^^ + 2 | opacity: 1; + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^^^^^ + 2 | opacity: 1; + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^^^^^ + 2 | opacity: 1; + `---- + + x Ident + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^^^^ + 2 | opacity: 1; + `---- + + x Combinator + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^ + 2 | opacity: 1; + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^^^^^ + 2 | opacity: 1; + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^ + 2 | opacity: 1; + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^ + 2 | opacity: 1; + `---- + + x Ident + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^ + 2 | opacity: 1; + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^ + 2 | opacity: 1; + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^ + 2 | opacity: 1; + `---- + + x Ident + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^ + 2 | opacity: 1; + `---- + + x ComplexSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + 2 | opacity: 1; + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^ + 2 | opacity: 1; + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^ + 2 | opacity: 1; + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^ + 2 | opacity: 1; + `---- + + x Ident + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^ + 2 | opacity: 1; + `---- + + x Combinator + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^ + 2 | opacity: 1; + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^^^^^ + 2 | opacity: 1; + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^^^^^ + 2 | opacity: 1; + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^^^^^ + 2 | opacity: 1; + `---- + + x Ident + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^^^^ + 2 | opacity: 1; + `---- + + x Combinator + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^ + 2 | opacity: 1; + `---- + + x CompoundSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^^^^^ + 2 | opacity: 1; + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^ + 2 | opacity: 1; + `---- + + x ClassSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^ + 2 | opacity: 1; + `---- + + x Ident + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^ + 2 | opacity: 1; + `---- + + x SubclassSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^ + 2 | opacity: 1; + `---- + + x PseudoClassSelector + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^^ + 2 | opacity: 1; + `---- + + x Ident + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^^^^^ + 2 | opacity: 1; + `---- + + x SimpleBlock + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | ,-> .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + 2 | | opacity: 1; + 3 | | filter: alpha(opacity=100); + 4 | `-> } + `---- + + x LBrace + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + : ^ + 2 | opacity: 1; + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + 2 | opacity: 1; + : ^^^^^^^^^^ + 3 | filter: alpha(opacity=100); + `---- + + x Declaration + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + 2 | opacity: 1; + : ^^^^^^^^^^ + 3 | filter: alpha(opacity=100); + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + 2 | opacity: 1; + : ^^^^^^^ + 3 | filter: alpha(opacity=100); + `---- + + x Ident + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + 2 | opacity: 1; + : ^^^^^^^ + 3 | filter: alpha(opacity=100); + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + 2 | opacity: 1; + : ^ + 3 | filter: alpha(opacity=100); + `---- + + x Integer + ,-[$DIR/tests/fixture/turbo/4092/input.css:1:1] + 1 | .carousel .control-dots .dot.selected, .carousel .control-dots .dot:hover { + 2 | opacity: 1; + : ^ + 3 | filter: alpha(opacity=100); + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/turbo/4092/input.css:2:1] + 2 | opacity: 1; + 3 | filter: alpha(opacity=100); + : ^^^^^^^^^^^^^^^^^^^^^^^^^^ + 4 | } + `---- + + x Declaration + ,-[$DIR/tests/fixture/turbo/4092/input.css:2:1] + 2 | opacity: 1; + 3 | filter: alpha(opacity=100); + : ^^^^^^^^^^^^^^^^^^^^^^^^^^ + 4 | } + `---- + + x DeclarationName + ,-[$DIR/tests/fixture/turbo/4092/input.css:2:1] + 2 | opacity: 1; + 3 | filter: alpha(opacity=100); + : ^^^^^^ + 4 | } + `---- + + x Ident + ,-[$DIR/tests/fixture/turbo/4092/input.css:2:1] + 2 | opacity: 1; + 3 | filter: alpha(opacity=100); + : ^^^^^^ + 4 | } + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/turbo/4092/input.css:2:1] + 2 | opacity: 1; + 3 | filter: alpha(opacity=100); + : ^^^^^^^^^^^^^^^^^^ + 4 | } + `---- + + x Function + ,-[$DIR/tests/fixture/turbo/4092/input.css:2:1] + 2 | opacity: 1; + 3 | filter: alpha(opacity=100); + : ^^^^^^^^^^^^^^^^^^ + 4 | } + `---- + + x Ident + ,-[$DIR/tests/fixture/turbo/4092/input.css:2:1] + 2 | opacity: 1; + 3 | filter: alpha(opacity=100); + : ^^^^^ + 4 | } + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/turbo/4092/input.css:2:1] + 2 | opacity: 1; + 3 | filter: alpha(opacity=100); + : ^^^^^^^ + 4 | } + `---- + + x Ident + ,-[$DIR/tests/fixture/turbo/4092/input.css:2:1] + 2 | opacity: 1; + 3 | filter: alpha(opacity=100); + : ^^^^^^^ + 4 | } + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/turbo/4092/input.css:2:1] + 2 | opacity: 1; + 3 | filter: alpha(opacity=100); + : ^ + 4 | } + `---- + + x Delim { value: '=' } + ,-[$DIR/tests/fixture/turbo/4092/input.css:2:1] + 2 | opacity: 1; + 3 | filter: alpha(opacity=100); + : ^ + 4 | } + `---- + + x ComponentValue + ,-[$DIR/tests/fixture/turbo/4092/input.css:2:1] + 2 | opacity: 1; + 3 | filter: alpha(opacity=100); + : ^^^ + 4 | } + `---- + + x Integer + ,-[$DIR/tests/fixture/turbo/4092/input.css:2:1] + 2 | opacity: 1; + 3 | filter: alpha(opacity=100); + : ^^^ + 4 | } + `----