mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-05-31 06:46:37 +02:00
tests: ls: verify in-group ordering with --group-directories-first
* tests/ls/group-dirs.sh: Check that entries within each group remain alphabetically sorted, and that equal-size files keep a deterministic order when combined with --sort=size. https://github.com/uutils/coreutils/issues/11997 https://github.com/coreutils/coreutils/pull/267
This commit is contained in:
committed by
Pádraig Brady
parent
6f8600f5d1
commit
e32eaee1f0
@@ -40,4 +40,24 @@ dir/a
|
||||
EOF
|
||||
compare exp out || fail=1
|
||||
|
||||
# Ensure entries within each group remain alphabetically sorted, and
|
||||
# that equal-size files keep a deterministic (by-name) order when
|
||||
# combined with --sort=size.
|
||||
mkdir dir2 dir2/dir_b dir2/dir_a dir2/dir_c || framework_failure_
|
||||
touch dir2/file_c dir2/file_a dir2/file_b || framework_failure_
|
||||
|
||||
ls --group-directories-first dir2 > out || fail=1
|
||||
cat <<\EOF > exp
|
||||
dir_a
|
||||
dir_b
|
||||
dir_c
|
||||
file_a
|
||||
file_b
|
||||
file_c
|
||||
EOF
|
||||
compare exp out || fail=1
|
||||
|
||||
ls --group-directories-first --sort=size dir2 > out || fail=1
|
||||
compare exp out || fail=1
|
||||
|
||||
Exit $fail
|
||||
|
||||
Reference in New Issue
Block a user