Skip to content

Commit

Permalink
Use snapshots for remaining lexer tests (#7264)
Browse files Browse the repository at this point in the history
## Summary

This PR updates the remaining lexer test cases to use the snapshots.
This is mainly a mechanical refactor.

## Motivation

The main motivation is so that when we add the token range values to the
test case output, it's easier to update the test cases.

The reason they were not using the snapshots before was because of the usage of
`test_case` macro. The macros is mainly used for different EOL test cases. If we
just generate the snapshots directly, then the snapshot name would be suffixed
with `-1`, `-2`, etc. as the test function is still the same. So, we'll create
the snapshot ourselves with the platform name for the respective EOL
test cases.

## Test Plan

`cargo test`
  • Loading branch information
dhruvmanila authored Sep 11, 2023
1 parent ff0feb1 commit f5701fc
Show file tree
Hide file tree
Showing 35 changed files with 846 additions and 273 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/ruff_python_parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ static_assertions = "1.1.0"

[dev-dependencies]
insta = { workspace = true }
test-case = { workspace = true }

[build-dependencies]
anyhow = { workspace = true }
Expand Down
Loading

0 comments on commit f5701fc

Please sign in to comment.