2 # Test --classify processing
4 # Copyright (C) 2020-2025 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 mkdir testdir || framework_failure_
23 cd testdir || framework_failure_
24 mkdir dir || framework_failure_
25 touch regular executable || framework_failure_
26 chmod a
+x executable || framework_failure_
27 ln -s regular slink-reg || framework_failure_
28 ln -s dir slink-dir || framework_failure_
29 ln -s nowhere slink-dangle || framework_failure_
30 mknod block b
20 20 2> /dev
/null
&& block
="block
32 mknod char c
10 10 2> /dev
/null
&& char
="char
46 sed 's/[*/@|]//' exp
> exp2 || framework_failure_
48 ls --classify testdir
> out || fail
=1
49 ls --classify=always testdir
> out2 || fail
=1
50 ls --classify=auto testdir
> out3 || fail
=1
51 ls --classify=never testdir
> out4 || fail
=1
53 compare exp out || fail
=1
55 compare exp out2 || fail
=1
57 compare exp2 out3 || fail
=1
59 compare exp2 out4 || fail
=1
61 returns_
1 ls --classify=invalid || fail
=1