From cee6c25cc49c73d2eaf7fb7551943dc0bbb4b4f2 Mon Sep 17 00:00:00 2001 From: Jeffrey Finkelstein Date: Mon, 10 Oct 2022 10:41:43 -0400 Subject: [PATCH] cp: make test for interactive mode more specific --- tests/by-util/test_cp.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/by-util/test_cp.rs b/tests/by-util/test_cp.rs index 8860a57a5..ecba6addd 100644 --- a/tests/by-util/test_cp.rs +++ b/tests/by-util/test_cp.rs @@ -217,15 +217,18 @@ fn test_cp_target_directory_is_file() { #[test] fn test_cp_arg_interactive() { - new_ucmd!() - .arg(TEST_HELLO_WORLD_SOURCE) - .arg(TEST_HOW_ARE_YOU_SOURCE) - .arg("-i") + let (at, mut ucmd) = at_and_ucmd!(); + at.touch("a"); + at.touch("b"); + // TODO The prompt in GNU cp is different, and it doesn't have the + // response either. + // + // See . + ucmd.args(&["-i", "a", "b"]) .pipe_in("N\n") .succeeds() .no_stdout() - .stderr_contains(format!("overwrite '{}'?", TEST_HOW_ARE_YOU_SOURCE)) - .stderr_contains("Not overwriting"); + .stderr_is("cp: overwrite 'b'? [y/N]: cp: Not overwriting 'b' at user request\n"); } #[test]