diff options
author | Ethan P <eth-p+git@hidden.email> | 2020-05-15 12:29:01 -0700 |
---|---|---|
committer | Ethan P <eth-p+git@hidden.email> | 2020-05-15 12:29:01 -0700 |
commit | 9166c9dd355700067adb117382d6246bdefb8c7d (patch) | |
tree | df37e9e1c237a5e5b2787761b01c2d8b70581b5e /tests | |
parent | cc52f79e421d8f4e18600605340cdeee7ecd6c02 (diff) |
Remove unnecessary clone in integration tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration_tests.rs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 6e49cff6..36954b3d 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -679,19 +679,16 @@ fn do_not_panic_regression_tests() { fn do_not_detect_different_syntax_for_stdin_and_files() { let file = "regression_tests/issue_985.js"; - let output_for_file = bat() + let cmd_for_file = bat() .arg("--color=always") .arg("--map-syntax=*.js:Markdown") .arg(&format!("--file-name={}", file)) .arg("--style=plain") .arg(file) .assert() - .success() - .get_output() - .stdout - .clone(); + .success(); - let output_for_stdin = bat() + let cmd_for_stdin = bat() .arg("--color=always") .arg("--map-syntax=*.js:Markdown") .arg("--style=plain") @@ -699,13 +696,10 @@ fn do_not_detect_different_syntax_for_stdin_and_files() { .pipe_stdin(Path::new(EXAMPLES_DIR).join(file)) .unwrap() .assert() - .success() - .get_output() - .stdout - .clone(); + .success(); assert_eq!( - from_utf8(&output_for_file).unwrap(), - from_utf8(&output_for_stdin).unwrap() + from_utf8(&cmd_for_file.get_output().stdout).expect("output is valid utf-8"), + from_utf8(&cmd_for_stdin.get_output().stdout).expect("output is valid utf-8") ); } |