You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having some trouble getting the tests running correctly in Windows.
I'm currently looking at the swc_css_parser tests and for some reason most of them are failing due to the line numbers being incorrect. For example, if a run cargo test -p swc_css_parser span_visualizer_line_comment_tests__line_comment__css_in_js__5__input_css I get an output which includes the following:
This output implies that the results generated on my machine have both "color: red;" and "}" as line 4, which is obviously incorrect.
I've done a little debugging to try and understand what's going on, and it seems to be something to do with an \r being included in the } line, but not the following \n, and "miette" seems to get confused about the line numbers when that happens (I tried upgrading miette to 5.1.0, but it didn't help). If I switch the line endings in the input file to just \n then I get a slightly different error:
I'm very much new to Rust (in fact this is the first time I've used it), so there's definitely the possibility I'm overlooking something obvious, and any guidance around what I can look at to try and resolve the issue would be appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey folks,
I'm having some trouble getting the tests running correctly in Windows.
I'm currently looking at the swc_css_parser tests and for some reason most of them are failing due to the line numbers being incorrect. For example, if a run
cargo test -p swc_css_parser span_visualizer_line_comment_tests__line_comment__css_in_js__5__input_css
I get an output which includes the following:This output implies that the results generated on my machine have both "color: red;" and "}" as line 4, which is obviously incorrect.
I've done a little debugging to try and understand what's going on, and it seems to be something to do with an
\r
being included in the}
line, but not the following\n
, and "miette" seems to get confused about the line numbers when that happens (I tried upgrading miette to 5.1.0, but it didn't help). If I switch the line endings in the input file to just\n
then I get a slightly different error:This fixes things a little bit, but the test still fails.
So I know the tests are running fine within github on Windows, as the test passed in the latest action run: https://github.com/swc-project/swc/actions/runs/8086769343/job/22097269634
I'm very much new to Rust (in fact this is the first time I've used it), so there's definitely the possibility I'm overlooking something obvious, and any guidance around what I can look at to try and resolve the issue would be appreciated.
Cheers,
Phil
Beta Was this translation helpful? Give feedback.
All reactions