2 # Ensure "ls --color" doesn't output colors for TERM=dumb
4 # Copyright (C) 2014-2024 Free Software Foundation, Inc.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <https://www.gnu.org/licenses/>.
19 .
"${srcdir=.}/tests/init.sh"; path_prepend_ .
/src
22 # Output time as something constant
23 export TIME_STYLE
="+norm"
25 touch exe || framework_failure_
26 chmod u
+x exe || framework_failure_
29 LS_COLORS
='' COLORTERM
='nonempty' TERM
='' ls --color=always exe
>> out || fail
=1
30 LS_COLORS
='' COLORTERM
='' TERM
='xterm' ls --color=always exe
>> out || fail
=1
33 LS_COLORS
='' COLORTERM
='' TERM
='dumb' ls --color=always exe
>> out || fail
=1
34 LS_COLORS
='' COLORTERM
='' TERM
='' ls --color=always exe
>> out || fail
=1
36 cat -A out
> out.display || framework_failure_
37 mv out.display out || framework_failure_
39 cat <<\EOF
> exp || framework_failure_
40 ^
[[0m^
[[01;32mexe^
[[0m$
41 ^
[[0m^
[[01;32mexe^
[[0m$
46 compare exp out || fail
=1