Index: tests/ls/inode =================================================================== RCS file: /sources/coreutils/coreutils/tests/ls/inode,v retrieving revision 1.2 diff -u -p -r1.2 inode --- tests/ls/inode 18 Jan 2003 18:06:38 -0000 1.2 +++ tests/ls/inode 27 Feb 2006 05:41:15 -0000 @@ -24,6 +24,8 @@ fi fail=0 +# When listed explicitly: + set x `ls -Ci f slink`; shift test $# = 4 || fail=1 # The inode numbers should differ. @@ -36,7 +38,7 @@ test "$1" = "$3" || fail=1 set x `ls -CHi f slink`; shift test $# = 4 || fail=1 -# With -H, they must be the same, too. +# With -H, they must be the same, too, from the command line. # Note that POSIX says -H must make ls dereference only # symlinks (specified on the command line) to directories, # but the historical BSD meaning of -H is to dereference @@ -44,4 +46,21 @@ test $# = 4 || fail=1 # implements the BSD semantics. test "$1" = "$3" || fail=1 +# When listed from a directory: + +set x `ls -Ci`; shift +test $# = 4 || fail=1 +# The inode numbers should differ. +test "$1" != "$3" || fail=1 + +set x `ls -CLi`; shift +test $# = 4 || fail=1 +# With -L, they must be the same. +test "$1" = "$3" || fail=1 + +set x `ls -CHi`; shift +test $# = 4 || fail=1 +# With -H, they must be different from inside a directory. +test "$1" != "$3" || fail=1 + (exit $fail); exit $fail Index: tests/ls/follow-slink =================================================================== RCS file: /sources/coreutils/coreutils/tests/ls/follow-slink,v retrieving revision 1.5 diff -u -p -r1.5 follow-slink --- tests/ls/follow-slink 23 Jun 2004 15:07:04 -0000 1.5 +++ tests/ls/follow-slink 27 Feb 2006 05:41:15 -0000 @@ -14,6 +14,10 @@ trap '(exit $?); exit' 1 2 13 15 framework_failure=0 mkdir $tmp || framework_failure=1 cd $tmp || framework_failure=1 + +# Isolate output files from directory being listed +mkdir dir || framework_failure=1 +cd dir || framework_failure=1 ln -s link link || framework_failure=1 # Make sure the symlink was created. @@ -28,6 +32,22 @@ fi fail=0 +# When explicitly listing a broken link, the command must fail. ls -L link 2> /dev/null && fail=1 +# When encountering a broken link implicitly, Solaris 9 and OpenBSD 3.4 +# list the link, provided no further information about the link needed +# to be printed. Since POSIX does not specify one way or the other, we +# opt for compatibility (this was broken in 5.3.0 through 5.94). +ls -L > ../out || fail=1 + +cd .. || fail=1 + +cat <<\EOF > exp +link +EOF + +cmp out exp || fail=1 +test $fail = 1 && diff out exp 2> /dev/null + (exit $fail); exit $fail