From 55985aa242bba18aad0c6b652127571d3d8a695b Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Thu, 17 Sep 2020 17:59:46 -0700 Subject: [PATCH] Combine integration tests into single binary (#679) 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`. --- Cargo.toml | 5 +++++ src/lexer.rs | 10 ++-------- tests/lib.rs | 12 ++++++++++++ tests/{integration.rs => misc.rs} | 0 4 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 tests/lib.rs rename tests/{integration.rs => misc.rs} (100%) diff --git a/Cargo.toml b/Cargo.toml index a2f8f58..8991536 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 = [] @@ -53,3 +54,7 @@ targets = ["x86_64-unknown-linux-gnu"] [profile.release] lto = true + +[[test]] +name = "integration" +path = "tests/lib.rs" diff --git a/src/lexer.rs b/src/lexer.rs index 4141794..c5189f3 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -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 @@ -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 diff --git a/tests/lib.rs b/tests/lib.rs new file mode 100644 index 0000000..9b57557 --- /dev/null +++ b/tests/lib.rs @@ -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; diff --git a/tests/integration.rs b/tests/misc.rs similarity index 100% rename from tests/integration.rs rename to tests/misc.rs