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
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

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