-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(css/parser): Improve tests (#4963)
- Loading branch information
1 parent
91cff0a
commit 1b7b4f0
Showing
161 changed files
with
45,821 additions
and
1,301 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
135 changes: 135 additions & 0 deletions
135
crates/swc_css_parser/tests/line-comment/css-in-js/1/span.rust-debug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
|
||
x Stylesheet | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:1:1] | ||
1 | ,-> // Line comment | ||
2 | | foo { | ||
3 | | color: red; | ||
4 | `-> } | ||
`---- | ||
|
||
x Rule | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:1:1] | ||
1 | ,-> // Line comment | ||
2 | | foo { | ||
3 | | color: red; | ||
4 | `-> } | ||
`---- | ||
|
||
x QualifiedRule | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:1:1] | ||
1 | ,-> // Line comment | ||
2 | | foo { | ||
3 | | color: red; | ||
4 | `-> } | ||
`---- | ||
|
||
x Tokens | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:1:1] | ||
1 | ,-> // Line comment | ||
2 | `-> foo { | ||
`---- | ||
|
||
x Delim { value: '/' } | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:1:1] | ||
1 | // Line comment | ||
: ^ | ||
`---- | ||
|
||
x Delim { value: '/' } | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:1:1] | ||
1 | // Line comment | ||
: ^ | ||
`---- | ||
|
||
x WhiteSpace { value: Atom(' ' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:1:1] | ||
1 | // Line comment | ||
: ^ | ||
`---- | ||
|
||
x Ident { value: Atom('Line' type=inline), raw: Atom('Line' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:1:1] | ||
1 | // Line comment | ||
: ^^^^ | ||
`---- | ||
|
||
x WhiteSpace { value: Atom(' ' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:1:1] | ||
1 | // Line comment | ||
: ^ | ||
`---- | ||
|
||
x Ident { value: Atom('comment' type=inline), raw: Atom('comment' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:1:1] | ||
1 | // Line comment | ||
: ^^^^^^^ | ||
`---- | ||
|
||
x WhiteSpace { value: Atom(' | ||
| ' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:1:1] | ||
1 | // Line comment | ||
: ^ | ||
2 | foo { | ||
`---- | ||
|
||
x Ident { value: Atom('foo' type=inline), raw: Atom('foo' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:2:1] | ||
2 | foo { | ||
: ^^^ | ||
`---- | ||
|
||
x WhiteSpace { value: Atom(' ' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:2:1] | ||
2 | foo { | ||
: ^ | ||
`---- | ||
|
||
x SimpleBlock | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:2:1] | ||
2 | ,-> foo { | ||
3 | | color: red; | ||
4 | `-> } | ||
`---- | ||
|
||
x ComponentValue | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:3:5] | ||
3 | color: red; | ||
: ^^^^^^^^^^ | ||
`---- | ||
|
||
x StyleBlock | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:3:5] | ||
3 | color: red; | ||
: ^^^^^^^^^^ | ||
`---- | ||
|
||
x Declaration | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:3:5] | ||
3 | color: red; | ||
: ^^^^^^^^^^ | ||
`---- | ||
|
||
x DeclarationName | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:3:5] | ||
3 | color: red; | ||
: ^^^^^ | ||
`---- | ||
|
||
x Ident | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:3:5] | ||
3 | color: red; | ||
: ^^^^^ | ||
`---- | ||
|
||
x ComponentValue | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:3:5] | ||
3 | color: red; | ||
: ^^^ | ||
`---- | ||
|
||
x Ident | ||
,-[$DIR/tests/line-comment/css-in-js/1/input.css:3:5] | ||
3 | color: red; | ||
: ^^^ | ||
`---- |
84 changes: 84 additions & 0 deletions
84
crates/swc_css_parser/tests/line-comment/css-in-js/10/span.rust-debug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
|
||
x Stylesheet | ||
,-[$DIR/tests/line-comment/css-in-js/10/input.css:1:1] | ||
1 | // Only comment // test | ||
: ^^^^^^^^^^^^^^^^^^^^^^^ | ||
`---- | ||
|
||
x Rule | ||
,-[$DIR/tests/line-comment/css-in-js/10/input.css:1:1] | ||
1 | // Only comment // test | ||
: ^^^^^^^^^^^^^^^^^^^^^^^ | ||
`---- | ||
|
||
x Tokens | ||
,-[$DIR/tests/line-comment/css-in-js/10/input.css:1:1] | ||
1 | // Only comment // test | ||
: ^^^^^^^^^^^^^^^^^^^^^^^ | ||
`---- | ||
|
||
x Delim { value: '/' } | ||
,-[$DIR/tests/line-comment/css-in-js/10/input.css:1:1] | ||
1 | // Only comment // test | ||
: ^ | ||
`---- | ||
|
||
x Delim { value: '/' } | ||
,-[$DIR/tests/line-comment/css-in-js/10/input.css:1:1] | ||
1 | // Only comment // test | ||
: ^ | ||
`---- | ||
|
||
x WhiteSpace { value: Atom(' ' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/10/input.css:1:1] | ||
1 | // Only comment // test | ||
: ^ | ||
`---- | ||
|
||
x Ident { value: Atom('Only' type=inline), raw: Atom('Only' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/10/input.css:1:1] | ||
1 | // Only comment // test | ||
: ^^^^ | ||
`---- | ||
|
||
x WhiteSpace { value: Atom(' ' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/10/input.css:1:1] | ||
1 | // Only comment // test | ||
: ^ | ||
`---- | ||
|
||
x Ident { value: Atom('comment' type=inline), raw: Atom('comment' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/10/input.css:1:1] | ||
1 | // Only comment // test | ||
: ^^^^^^^ | ||
`---- | ||
|
||
x WhiteSpace { value: Atom(' ' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/10/input.css:1:1] | ||
1 | // Only comment // test | ||
: ^ | ||
`---- | ||
|
||
x Delim { value: '/' } | ||
,-[$DIR/tests/line-comment/css-in-js/10/input.css:1:1] | ||
1 | // Only comment // test | ||
: ^ | ||
`---- | ||
|
||
x Delim { value: '/' } | ||
,-[$DIR/tests/line-comment/css-in-js/10/input.css:1:1] | ||
1 | // Only comment // test | ||
: ^ | ||
`---- | ||
|
||
x WhiteSpace { value: Atom(' ' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/10/input.css:1:1] | ||
1 | // Only comment // test | ||
: ^ | ||
`---- | ||
|
||
x Ident { value: Atom('test' type=inline), raw: Atom('test' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/10/input.css:1:1] | ||
1 | // Only comment // test | ||
: ^^^^ | ||
`---- |
165 changes: 165 additions & 0 deletions
165
crates/swc_css_parser/tests/line-comment/css-in-js/2/span.rust-debug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
|
||
x Stylesheet | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:1:1] | ||
1 | ,-> foo { | ||
2 | | // Line comment | ||
3 | | color: red; | ||
4 | `-> } | ||
`---- | ||
|
||
x Rule | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:1:1] | ||
1 | ,-> foo { | ||
2 | | // Line comment | ||
3 | | color: red; | ||
4 | `-> } | ||
`---- | ||
|
||
x QualifiedRule | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:1:1] | ||
1 | ,-> foo { | ||
2 | | // Line comment | ||
3 | | color: red; | ||
4 | `-> } | ||
`---- | ||
|
||
x SelectorList | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:1:1] | ||
1 | foo { | ||
: ^^^ | ||
`---- | ||
|
||
x ComplexSelector | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:1:1] | ||
1 | foo { | ||
: ^^^ | ||
`---- | ||
|
||
x CompoundSelector | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:1:1] | ||
1 | foo { | ||
: ^^^ | ||
`---- | ||
|
||
x TypeSelector | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:1:1] | ||
1 | foo { | ||
: ^^^ | ||
`---- | ||
|
||
x TagNameSelector | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:1:1] | ||
1 | foo { | ||
: ^^^ | ||
`---- | ||
|
||
x WqName | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:1:1] | ||
1 | foo { | ||
: ^^^ | ||
`---- | ||
|
||
x Ident | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:1:1] | ||
1 | foo { | ||
: ^^^ | ||
`---- | ||
|
||
x SimpleBlock | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:1:1] | ||
1 | ,-> foo { | ||
2 | | // Line comment | ||
3 | | color: red; | ||
4 | `-> } | ||
`---- | ||
|
||
x ComponentValue | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:2:5] | ||
2 | ,-> // Line comment | ||
3 | `-> color: red; | ||
`---- | ||
|
||
x StyleBlock | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:2:5] | ||
2 | ,-> // Line comment | ||
3 | `-> color: red; | ||
`---- | ||
|
||
x Tokens | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:2:5] | ||
2 | ,-> // Line comment | ||
3 | `-> color: red; | ||
`---- | ||
|
||
x Delim { value: '/' } | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:2:5] | ||
2 | // Line comment | ||
: ^ | ||
`---- | ||
|
||
x Delim { value: '/' } | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:2:5] | ||
2 | // Line comment | ||
: ^ | ||
`---- | ||
|
||
x WhiteSpace { value: Atom(' ' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:2:5] | ||
2 | // Line comment | ||
: ^ | ||
`---- | ||
|
||
x Ident { value: Atom('Line' type=inline), raw: Atom('Line' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:2:5] | ||
2 | // Line comment | ||
: ^^^^ | ||
`---- | ||
|
||
x WhiteSpace { value: Atom(' ' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:2:5] | ||
2 | // Line comment | ||
: ^ | ||
`---- | ||
|
||
x Ident { value: Atom('comment' type=inline), raw: Atom('comment' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:2:5] | ||
2 | // Line comment | ||
: ^^^^^^^ | ||
`---- | ||
|
||
x WhiteSpace { value: Atom(' | ||
| ' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:2:5] | ||
2 | ,-> // Line comment | ||
3 | `-> color: red; | ||
`---- | ||
|
||
x Ident { value: Atom('color' type=inline), raw: Atom('color' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:3:5] | ||
3 | color: red; | ||
: ^^^^^ | ||
`---- | ||
|
||
x Colon | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:3:5] | ||
3 | color: red; | ||
: ^ | ||
`---- | ||
|
||
x WhiteSpace { value: Atom(' ' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:3:5] | ||
3 | color: red; | ||
: ^ | ||
`---- | ||
|
||
x Ident { value: Atom('red' type=inline), raw: Atom('red' type=inline) } | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:3:5] | ||
3 | color: red; | ||
: ^^^ | ||
`---- | ||
|
||
x Semi | ||
,-[$DIR/tests/line-comment/css-in-js/2/input.css:3:5] | ||
3 | color: red; | ||
: ^ | ||
`---- |
Oops, something went wrong.