From dfd403c8d24e881d09703a580cb6a3c8d257adf3 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 23 Aug 2020 22:50:16 -0500 Subject: Peter McConalogue pointed out that cp/mv -i prompt should default N. Also, the failing mv test was because posix says to prompt when mv-ing over an unwriteable file only when stdin is a tty (but -i prompts either way) --- tests/mv.test | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'tests') diff --git a/tests/mv.test b/tests/mv.test index ed8922ac..3731bf6c 100755 --- a/tests/mv.test +++ b/tests/mv.test @@ -135,32 +135,16 @@ testing "no clobber (dest doesn't exist)" \ "yes\n" "" "" rm -f file* -# If there is stdin, it prompts. If no stdin, it moves anyway and file2 won't -# exist. touch file1 file2 chmod 400 file1 file2 -testing "mv over unwritable file: no stdin" \ +testing "over unwritable file only prompts when stdin is a terminal" \ "mv file2 file1 2>/dev/null && [ -e file1 -a ! -e file2 ] && echo yes" \ "yes\n" "" "" rm -f file* -touch file1 file2 -chmod 400 file1 file2 -testing "mv over unwritable file: answered YES" \ - "mv file2 file1 2>/dev/null && [ -e file1 -a ! -e file2 ] && echo yes" \ - "yes\n" "" "y\n" -rm -f file* - -touch file1 file2 -chmod 400 file1 file2 -testing "mv over unwritable file: answered NO" \ - "mv file2 file1 2>/dev/null && [ -e file1 -a -e file2 ] && echo yes" \ - "yes\n" "" "n\n" -rm -f file* - touch file1 file2 testing "interactive: no stdin" \ - "mv -i file2 file1 2>/dev/null && [ -e file1 -a ! -e file2 ] && echo yes" \ + "mv -i file2 file1 2>/dev/null && [ -e file1 -a -e file2 ] && echo yes" \ "yes\n" "" "" rm -f file* -- cgit v1.2.3