Skip to content

Commit

Permalink
Move lexer unit tests to rustc_lexer
Browse files Browse the repository at this point in the history
StringReader is an intornal abstraction which at the moment changes a
lot, so these unit tests cause quite a bit of friction.

Moving them to rustc_lexer and more ingerated-testing style should
make them much less annoying, hopefully without decreasing their
usefulness much.

Note that coloncolon tests are removed (it's unclear what those are
testing).

\r\n tests are removed as well, as we normalize line endings even
before lexing.
  • Loading branch information
matklad committed Aug 30, 2020
1 parent 85fbf49 commit ccffea5
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 278 deletions.
15 changes: 14 additions & 1 deletion Cargo.lock
Expand Up @@ -342,7 +342,7 @@ dependencies = [
name = "cargo-miri"
version = "0.1.0"
dependencies = [
"cargo_metadata 0.11.1",
"cargo_metadata 0.9.1",
"directories",
"rustc-workspace-hack",
"rustc_version",
Expand Down Expand Up @@ -391,6 +391,18 @@ dependencies = [
"serde_json",
]

[[package]]
name = "cargo_metadata"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46e3374c604fb39d1a2f35ed5e4a4e30e60d01fab49446e08f1b3e9a90aef202"
dependencies = [
"semver 0.9.0",
"serde",
"serde_derive",
"serde_json",
]

[[package]]
name = "cargo_metadata"
version = "0.11.1"
Expand Down Expand Up @@ -1979,6 +1991,7 @@ dependencies = [
name = "miri"
version = "0.1.0"
dependencies = [
"byteorder",
"colored",
"compiletest_rs",
"env_logger 0.7.1",
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_expand/src/lib.rs
Expand Up @@ -39,11 +39,6 @@ mod tests;
mod parse {
#[cfg(test)]
mod tests;
#[cfg(test)]
mod lexer {
#[cfg(test)]
mod tests;
}
}
#[cfg(test)]
mod tokenstream {
Expand Down
252 changes: 0 additions & 252 deletions compiler/rustc_expand/src/parse/lexer/tests.rs

This file was deleted.

0 comments on commit ccffea5

Please sign in to comment.