diff options
author | sharkdp <davidpeter@web.de> | 2020-11-24 21:01:17 +0100 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2020-11-24 21:40:11 +0100 |
commit | bd2e9917da5cf5b4f7bae48ef5b97ce5cead2803 (patch) | |
tree | b48a10d75116c928e2671d9913b43045c68bb3ac | |
parent | a6810e3353db8536015b830b28e45e5e0167fdac (diff) |
Revert "Add cycle detection integration tests"
This reverts commit ec60d84265037f2fa230af0317fa75b2e949c59c.
-rw-r--r-- | tests/examples/cycle.txt | 0 | ||||
-rw-r--r-- | tests/integration_tests.rs | 37 |
2 files changed, 3 insertions, 34 deletions
diff --git a/tests/examples/cycle.txt b/tests/examples/cycle.txt deleted file mode 100644 index e69de29b..00000000 --- a/tests/examples/cycle.txt +++ /dev/null diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index ad3ca9d0..ac11efb4 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -1,14 +1,11 @@ -use assert_cmd::assert::OutputAssertExt; -use assert_cmd::cargo::CommandCargoExt; +use assert_cmd::Command; use predicates::{prelude::predicate, str::PredicateStrExt}; -use std::fs::File; use std::path::Path; -use std::process::{Command, Stdio}; use std::str::from_utf8; const EXAMPLES_DIR: &str = "tests/examples"; -fn bat_as_std() -> Command { +fn bat_with_config() -> Command { let mut cmd = Command::cargo_bin("bat").unwrap(); cmd.current_dir("tests/examples"); cmd.env_remove("PAGER"); @@ -20,11 +17,7 @@ fn bat_as_std() -> Command { cmd } -fn bat_with_config() -> assert_cmd::Command { - assert_cmd::Command::from_std(bat_as_std()) -} - -fn bat() -> assert_cmd::Command { +fn bat() -> Command { let mut cmd = bat_with_config(); cmd.arg("--no-config"); cmd @@ -197,30 +190,6 @@ fn line_range_multiple() { } #[test] -fn basic_io_cycle() { - let file_out = Stdio::from(File::open("tests/examples/cycle.txt").unwrap()); - bat_as_std() - .arg("test.txt") - .arg("cycle.txt") - .stdout(file_out) - .assert() - .failure(); -} - -#[test] -fn stdin_to_stdout_cycle() { - let file_out = Stdio::from(File::open("tests/examples/cycle.txt").unwrap()); - let file_in = Stdio::from(File::open("tests/examples/cycle.txt").unwrap()); - bat_as_std() - .stdin(file_in) - .arg("test.txt") - .arg("-") - .stdout(file_out) - .assert() - .failure(); -} - -#[test] fn tabs_numbers() { bat() .arg("tabs.txt") |