2 # Ensure "ls --color" properly colors other-writable and sticky directories.
3 # Before coreutils-6.2, this test would fail, coloring all three
4 # directories the same as the first one -- but only on a file system
5 # with dirent.d_type support.
7 # Copyright (C) 2006-2012 Free Software Foundation, Inc.
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 .
"${srcdir=.}/init.sh"; path_prepend_ ..
/src
25 # Don't let a different umask perturb the results.
28 mkdir d other-writable sticky || framework_failure_
29 chmod o
+w other-writable || framework_failure_
30 chmod o
+t sticky || framework_failure_
33 ls --color=always
> out || fail
=1
34 cat -A out
> o1 || fail
=1
37 cat <<\EOF
> exp || fail
=1
39 ^
[[34;42mother-writable^
[[0m$
44 compare exp out || fail
=1
48 # Turn off colors for other-writable dirs and ensure
49 # we fall back to the color for standard directories.
51 LS_COLORS
="ow=:" ls --color=always
> out || fail
=1
52 cat -A out
> o1 || fail
=1
55 cat <<\EOF
> exp || fail
=1
57 ^
[[01;34mother-writable^
[[0m$
62 compare exp out || fail
=1