patch/tests/no-mode-change-git-diff
Andreas Gruenbacher 7297352e16 Test suite portability fixes
Reported and fixed (mostly) by Christian Weisgerber <naddy@mips.inka.de>:
* tests/deep-directories: Avoid the bash >& redirection operator.
* tests/no-mode-change-git-diff: Instead of "stat -c", use "ls -l  sed".
* tests/read-only-files: A redirection failure for a special built-in causes
some shells (FreeBSD sh, OpenBSD sh (pdksh), some bash --posix) to exit, and
the colon command is a special built-in. Perform the redirection in a subshell.
2015-02-04 10:54:03 +01:00

35 lines
651 B
Plaintext

# Copyright (C) 2010-2012 Free Software Foundation, Inc.
#
# Copying and distribution of this file, with or without modification,
# in any medium, are permitted without royalty provided the copyright
# notice and this notice are preserved.
. $srcdir/test-lib.sh
require cat
require chmod
require stat
use_local_patch
use_tmpdir
echo 'ksplice' > f
chmod 755 f
cat > simple.diff <<EOF
diff --git a/f b/f
index 422a422a..736b6c7063690a 100644
--- a/f
+++ b/f
@@ -1 +1 @@
-ksplice
+ksplice rocks!
EOF
check 'patch -p1 < simple.diff || echo "Status: $?"' <<EOF
patching file f
EOF
check 'ls -l f | sed "s,\(..........\).*,\1,"' <<EOF
-rwxr-xr-x
EOF