Skip to content

Commit

Permalink
Combine integration tests into single binary (#679)
Browse files Browse the repository at this point in the history
Combine all integration test binaries into a single binary with the root
in `tests/lib.rs`. This also turns of automatic test discovery, so
when adding another set of integration tests, a mod statement will need
to be added to `tests/lib.rs`.
  • Loading branch information
casey authored Sep 18, 2020
1 parent c62ff5a commit 55985aa
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ homepage = "https://github.com/casey/just"
repository = "https://github.com/casey/just"
readme = "crates-io-readme.md"
edition = "2018"
autotests = false

[features]
default = []
Expand Down Expand Up @@ -53,3 +54,7 @@ targets = ["x86_64-unknown-linux-gnu"]

[profile.release]
lto = true

[[test]]
name = "integration"
path = "tests/lib.rs"
10 changes: 2 additions & 8 deletions src/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,7 @@ impl<'src> Lexer<'src> {

/// True if `c` can be the first character of an identifier
fn is_identifier_start(c: char) -> bool {
match c {
'a'..='z' | 'A'..='Z' | '_' => true,
_ => false,
}
matches!(c, 'a'..='z' | 'A'..='Z' | '_')
}

/// True if `c` can be a continuation character of an idenitifier
Expand All @@ -240,10 +237,7 @@ impl<'src> Lexer<'src> {
return true;
}

match c {
'0'..='9' | '-' => true,
_ => false,
}
matches!(c, '0'..='9' | '-')
}

/// Consume the text and produce a series of tokens
Expand Down
12 changes: 12 additions & 0 deletions tests/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
mod completions;
mod dotenv;
mod edit;
mod examples;
mod init;
mod interrupts;
mod invocation_directory;
mod misc;
mod readme;
mod search;
mod shell;
mod working_directory;
File renamed without changes.

0 comments on commit 55985aa

Please sign in to comment.