Merge pull request #305 from epage/test

test: Only run tests relevant for features
This commit is contained in:
Ed Page 2021-07-01 19:49:14 -05:00 committed by GitHub
commit c917ed845a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,7 @@
use assert_cmd::Command;
#[test]
#[cfg(feature = "dict")]
fn test_stdin_success() {
let mut cmd = Command::cargo_bin("typos").unwrap();
cmd.arg("-").write_stdin("Hello world");
@ -8,6 +9,7 @@ fn test_stdin_success() {
}
#[test]
#[cfg(feature = "dict")]
fn test_stdin_failure() {
let mut cmd = Command::cargo_bin("typos").unwrap();
cmd.arg("-").write_stdin("Apropriate world");
@ -15,6 +17,7 @@ fn test_stdin_failure() {
}
#[test]
#[cfg(feature = "dict")]
fn test_stdin_correct() {
let mut cmd = Command::cargo_bin("typos").unwrap();
cmd.arg("-")
@ -24,6 +27,7 @@ fn test_stdin_correct() {
}
#[test]
#[cfg(feature = "dict")]
fn test_file_failure() {
let mut cmd = Command::cargo_bin("typos").unwrap();
cmd.arg("README.md");
@ -31,6 +35,7 @@ fn test_file_failure() {
}
#[test]
#[cfg(feature = "dict")]
fn test_relative_dir_failure() {
let mut cmd = Command::cargo_bin("typos").unwrap();
cmd.arg(".");
@ -38,6 +43,7 @@ fn test_relative_dir_failure() {
}
#[test]
#[cfg(feature = "dict")]
fn test_assumed_dir_failure() {
let mut cmd = Command::cargo_bin("typos").unwrap();
cmd.assert().code(2);