diff options
author | Jim Meyering <jim@meyering.net> | 2000-10-31 07:57:29 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-10-31 07:57:29 +0000 |
commit | 577627b257e08046d48e452c9e7f739e5aac0f27 (patch) | |
tree | bc6e7ed945df6663abfb153dfbd5b53b05f0737b /tests | |
parent | 7e7943c97948561c1dd7bd0a04930c300b8f2c6f (diff) | |
download | coreutils-577627b257e08046d48e452c9e7f739e5aac0f27.tar.xz |
Fix the test so it actually does something.
Run each test also with mkdir's `-p' option.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/mkdir/perm | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/tests/mkdir/perm b/tests/mkdir/perm index fe78cb1eb..c5253c41e 100755 --- a/tests/mkdir/perm +++ b/tests/mkdir/perm @@ -31,26 +31,29 @@ tests=' 050 : :drwx-w-rwx: 050 : -m 312 :d-wx--x-w-: 160 : :drw---xrwx: + - : - :last: ' +for p in empty -p; do + test _$p = _empty && p= -old_IFS=$IFS -IFS=': + old_IFS=$IFS + IFS=': ' -set - $tests -IFS=$old_IFS - -while :; do - case $# in 0|1|2) break;; esac - - umask=$1 mode=$2 expected_perms=$3 - shift; shift; shift - umask $umask - mkdir $mode d || fail=1 - - actual_perms=`ls -ld d | sed 's/ .*//'` - test "$expected_perms" = "$actual_perms" \ - || { fail=1; echo expected $expected_perms, got $actual_perms; } - rmdir d || fail=1 + set - $tests + IFS=$old_IFS + + while :; do + umask=$1 mode=$2 expected_perms=$3 + test $expected_perms = last && break + shift; shift; shift + umask $umask + mkdir $p $mode d || fail=1 + + actual_perms=`ls -ld d | sed 's/ .*//'` + test "$expected_perms" = "$actual_perms" \ + || { fail=1; echo expected $expected_perms, got $actual_perms; } + rmdir d || fail=1 + done done (exit $fail); exit |