mirror of
https://github.com/sharkdp/bat
synced 2024-11-18 15:26:16 +00:00
Remove unnecessary clone in integration tests
This commit is contained in:
parent
cc52f79e42
commit
9166c9dd35
@ -679,19 +679,16 @@ fn do_not_panic_regression_tests() {
|
|||||||
fn do_not_detect_different_syntax_for_stdin_and_files() {
|
fn do_not_detect_different_syntax_for_stdin_and_files() {
|
||||||
let file = "regression_tests/issue_985.js";
|
let file = "regression_tests/issue_985.js";
|
||||||
|
|
||||||
let output_for_file = bat()
|
let cmd_for_file = bat()
|
||||||
.arg("--color=always")
|
.arg("--color=always")
|
||||||
.arg("--map-syntax=*.js:Markdown")
|
.arg("--map-syntax=*.js:Markdown")
|
||||||
.arg(&format!("--file-name={}", file))
|
.arg(&format!("--file-name={}", file))
|
||||||
.arg("--style=plain")
|
.arg("--style=plain")
|
||||||
.arg(file)
|
.arg(file)
|
||||||
.assert()
|
.assert()
|
||||||
.success()
|
.success();
|
||||||
.get_output()
|
|
||||||
.stdout
|
|
||||||
.clone();
|
|
||||||
|
|
||||||
let output_for_stdin = bat()
|
let cmd_for_stdin = bat()
|
||||||
.arg("--color=always")
|
.arg("--color=always")
|
||||||
.arg("--map-syntax=*.js:Markdown")
|
.arg("--map-syntax=*.js:Markdown")
|
||||||
.arg("--style=plain")
|
.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))
|
.pipe_stdin(Path::new(EXAMPLES_DIR).join(file))
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.assert()
|
.assert()
|
||||||
.success()
|
.success();
|
||||||
.get_output()
|
|
||||||
.stdout
|
|
||||||
.clone();
|
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
from_utf8(&output_for_file).unwrap(),
|
from_utf8(&cmd_for_file.get_output().stdout).expect("output is valid utf-8"),
|
||||||
from_utf8(&output_for_stdin).unwrap()
|
from_utf8(&cmd_for_stdin.get_output().stdout).expect("output is valid utf-8")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user