diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2005-04-29 21:49:06 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2005-04-29 21:49:06 +0000 |
commit | 57b38dad6b372346ab64775649b22c48619d4221 (patch) | |
tree | c9457ba301d376ef699e5e64de99edc1550f367e /tests | |
parent | b4dcd32039b0c8364fad8f1181d5acc6bdf1daf3 (diff) | |
download | coreutils-57b38dad6b372346ab64775649b22c48619d4221.tar.xz |
Don't use 'set -'. Simplify test construction.
Work even if the underyling system attaches ACLs to new dirs.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/mkdir/perm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/mkdir/perm b/tests/mkdir/perm index 8e3e97109..f325bb4b9 100755 --- a/tests/mkdir/perm +++ b/tests/mkdir/perm @@ -44,12 +44,14 @@ tests=' 027 : -m =+x : drwxr-x--- : d--x--x--- : - : - : last : last : ' +colon_tests=`echo $tests | sed 's/^ *//; s/ *: */:/g'` + for p in empty -p; do test _$p = _empty && p= old_IFS=$IFS IFS=':' - set - `(echo "$tests"|tr -d '\n'; echo)|sed 's/^ *//;s/ *:/:/g;s/: */:/g'` + set $colon_tests IFS=$old_IFS while :; do @@ -71,11 +73,11 @@ for p in empty -p; do mkdir $p $mode parent/sub || fail=1 - perms=`ls -ld parent | sed 's/ .*//'` + perms=`ls -ld parent | sed 's/ .*//; s/+$//'` test "$parent_perms" = "$perms" \ || { fail=1; echo parent: expected $parent_perms, got $perms; } - perms=`ls -ld parent/sub | sed 's/ .*//'` + perms=`ls -ld parent/sub | sed 's/ .*//; s/+$//'` test "$sub_perms" = "$perms" \ || { fail=1; echo parent/sub: expected $sub_perms, got $perms; } |