on master help sign in
Remove unnecessary clone in integration tests
commit9166c9dd355700067adb117382d6246bdefb8c7d authorEthan P <eth-p+git@hidden.email> dateFri 15 May 2020, 12:29 (6 years ago) parentcc52f79
1 file changed+6−12
tests/integration_tests.rs+6−12
tests/integration_tests.rs+6−12
@@ -679,19 +679,16 @@ fn do_not_panic_regression_tests() {
679679fn do_not_detect_different_syntax_for_stdin_and_files() {
680680 let file = "regression_tests/issue_985.js";
681681
682− let output_for_file = bat()
682+ let cmd_for_file = bat()
683683 .arg("--color=always")
684684 .arg("--map-syntax=*.js:Markdown")
685685 .arg(&format!("--file-name={}", file))
686686 .arg("--style=plain")
687687 .arg(file)
688688 .assert()
689− .success()
690− .get_output()
691− .stdout
692− .clone();
689+ .success();
693690
694− let output_for_stdin = bat()
691+ let cmd_for_stdin = bat()
695692 .arg("--color=always")
696693 .arg("--map-syntax=*.js:Markdown")
697694 .arg("--style=plain")
@@ -699,13 +696,10 @@ fn do_not_detect_different_syntax_for_stdin_and_files() {
699696 .pipe_stdin(Path::new(EXAMPLES_DIR).join(file))
700697 .unwrap()
701698 .assert()
702− .success()
703− .get_output()
704− .stdout
705− .clone();
699+ .success();
706700
707701 assert_eq!(
708− from_utf8(&output_for_file).unwrap(),
709− from_utf8(&output_for_stdin).unwrap()
702+ from_utf8(&cmd_for_file.get_output().stdout).expect("output is valid utf-8"),
703+ from_utf8(&cmd_for_stdin.get_output().stdout).expect("output is valid utf-8")
710704 );
711705}