mirror of
https://github.com/coreutils/coreutils.git
synced 2026-10-28 09:44:34 +08:00
tests: mv: test the behavior of symbolic links to "."
* tests/mv/part-hardlink-symlink.sh: Add a test case.
This commit is contained in:
1 parent
e4db330242
commit
b7575a9d7b
1 file changed
+15
@@ -55,4 +55,19 @@ test $1 = $3 || fail=1
|
||||
test -L "$dest/link1" || fail=1
|
||||
test "$(readlink "$dest/link1")" = realfile || fail=1
|
||||
|
||||
# Test symbolic links to "." across file systems.
|
||||
(mkdir -p "$dest"/a "$dest"/b c &&
|
||||
ln -s . "$dest"/a/symlink1 &&
|
||||
ln -s . "$dest"/a/symlink2) || framework_failure_
|
||||
(cd c && timeout -v 10 mv "$dest"/a "$dest"/b/ >out 2>err) || fail=1
|
||||
compare /dev/null out || fail=1
|
||||
compare /dev/null err || fail=1
|
||||
returns_ 1 test -d "$dest"/a || fail=1
|
||||
test -d "$dest"/b || fail=1
|
||||
test -d "$dest"/b/a || fail=1
|
||||
test -L "$dest"/b/a/symlink1 || fail=1
|
||||
test -L "$dest"/b/a/symlink2 || fail=1
|
||||
test "$(readlink "$dest"/b/a/symlink1)" = . || fail=1
|
||||
test "$(readlink "$dest"/b/a/symlink2)" = . || fail=1
|
||||
|
||||
Exit $fail
|
||||
Reference in new issue
Block a user