1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00
Commit graph

274 commits

Author SHA1 Message Date
Sylvestre Ledru
d04d0cd987
ls: fix the GNU test tests/ls/selinux.sh (#8281)
* ls: fix the GNU test tests/ls/selinux.sh

* Remove old comment

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* simpli

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-07-02 11:12:26 +02:00
Luv-Ray
fb2399f56b
fix clippy (#8275)
* fix clippy

* update

* update
2025-06-27 09:15:24 +02:00
Dorian Peron
3fe7f94396 test/ls: add test for locale-aware quoting 2025-06-25 00:49:01 +02:00
Sylvestre Ledru
dc9dd3fb70 l10n: port ls for translation + add french
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-06-23 22:29:12 +02:00
Sudhakar Verma
c674cf1839
Merge pull request #8217 from sudhackar/ls-fix
ls: follow symlinks for xattrs, fix #8216
2025-06-19 10:17:25 +02:00
Daniel Hofstetter
73e447224c Adapt to API changes in nix 2025-05-23 09:24:46 +02:00
Leo Emar-Kar
b14388ca41
ls: update chrono crate version and switch to new_lenient use (#7858)
* update chrono crate version and switch to new_lenient use

* bring back custom_tz_fmt and update test

* update chrono version in fuzz lock file

* replace boxing with parse_to_owned
2025-04-29 16:29:42 +02:00
Sylvestre Ledru
aacd6d4779
Merge pull request #7816 from drinkcat/test_ls_more_acl
test_ls: Improve acl test
2025-04-21 22:45:44 +02:00
Nicolas Boichat
adb23b154f test_ls: Improve acl test
Create a file with some ACL, and another without, and check that `+`
only appears on the file with ACL.
2025-04-21 17:19:06 +02:00
Nicolas Boichat
a3e837ea99 test_ls: Improve test_ls_perm_io_errors
Do more extensive test of the output to check long output for
metadata failure, without relying on GnuTests
2025-04-21 11:12:26 +02:00
Daniel Hofstetter
3210638168 ls,stat: fix single_char_pattern in tests 2025-04-18 13:52:47 +02:00
Daniel Hofstetter
6ea58ea0aa
Merge pull request #7768 from sylvestre/ls-selinux
ls: add selinux support
2025-04-18 09:07:10 +02:00
Sylvestre Ledru
cb419b4f77 ls: use the uucore functions 2025-04-17 18:27:56 +02:00
Sylvestre Ledru
4651a58b82 ls: add selinux support 2025-04-17 18:27:54 +02:00
Leo Emar-Kar
538355fb67
ls: add -T support and fix --classify output (#7616)
* add -T option parsing

* add usage of tab_size in display_grid

* fix test_ls_columns with \t

since this behavior is on by default

* update test_tabsize_formatting

* use grid DEFAULT_SEPARATOR_SIZE

* update Tabs

* fix test with column width

* fix cspell

* fix linter warning on match bool

* add comment for 0 tab_size

* update tabsize test with -C

* update one of the tabs tests to use -x

* remove comment and split tests for both x/C args
2025-04-17 14:29:22 +02:00
Yuri Astrakhan
170831ed2b chore: remove unneeded parens
Keeps code a bit more readable
2025-04-08 18:19:03 -04:00
Daniel Hofstetter
a77e218a79
Merge pull request #7690 from nyurik/manual-inline
chore: manual inline formatting - tests
2025-04-08 15:27:14 +02:00
Yuri Astrakhan
3dc771924c chore: cleanup trailing commas before parens
Deleted commas in cases like `foo,)` -- mostly in macros
2025-04-08 00:33:58 -04:00
Yuri Astrakhan
982805d3cd chore: manual inline formatting
Minor manual cleanup - inlined many format args.  This makes the code a bit more readable, and helps spot a few inefficiencies and possible bugs.  Note that `&foo` in a `format!` parameter results in a 6% extra performance cost, and does not get inlined by the compiler (yet).
2025-04-08 00:23:21 -04:00
Sylvestre Ledru
a0179ea239 uutests: adjust the tests to use them 2025-03-28 21:40:31 +01:00
Sylvestre Ledru
a85539f530 Run cargo fmt on the tree 2025-03-24 21:33:12 +01:00
Sylvestre Ledru
a193073556 disable some tests for now
Fails with:
```

---- test_ls::test_ls_color_norm stdout ----
touch: /tmp/.tmp9wbpVl/exe
touch: /tmp/.tmp9wbpVl/no_color
run: /home/runner.linux/work/target/debug/coreutils ls -gGU --color exe no_color
thread 'test_ls::test_ls_color_norm' panicked at tests/by-util/test_ls.rs:5307:10:
'norm exe
norm no_color
' does not contain 'norm exe
norm no_color'
---- test_ls::test_ls_inode stdout ----
touch: /tmp/.tmpiozh4d/test_inode
run: /home/runner.linux/work/target/debug/coreutils ls test_inode -i
run: /home/runner.linux/work/target/debug/coreutils ls test_inode
run: /home/runner.linux/work/target/debug/coreutils ls -li test_inode
thread 'test_ls::test_ls_inode' panicked at tests/by-util/test_ls.rs:2776:5:
assertion failed: re_long.is_match(result.stdout_str())
---- test_ls::test_ls_long_format stdout ----
mkdir: /tmp/.tmpDm1xDQ/test-long-dir
touch: /tmp/.tmpDm1xDQ/test-long-dir/test-long-file
mkdir: /tmp/.tmpDm1xDQ/test-long-dir/test-long-dir
run: /home/runner.linux/work/target/debug/coreutils ls -l test-long-dir
run: /home/runner.linux/work/target/debug/coreutils ls --long test-long-dir
run: /home/runner.linux/work/target/debug/coreutils ls --format=long test-long-dir
run: /home/runner.linux/work/target/debug/coreutils ls --format=lon test-long-dir
run: /home/runner.linux/work/target/debug/coreutils ls --for=long test-long-dir
run: /home/runner.linux/work/target/debug/coreutils ls --format=verbose test-long-dir
run: /home/runner.linux/work/target/debug/coreutils ls --for=verbose test-long-dir
run: /home/runner.linux/work/target/debug/coreutils ls -lan test-long-dir
thread 'test_ls::test_ls_long_format' panicked at tests/by-util/test_ls.rs:1139:62:
Stdout does not match regex:
total 0
drwxr-xr-x+ 3 1001 1001 80 Mar 14 08:14 .
drwxr-xr-x+ 3 1001 1001 60 Mar 14 08:14 ..
drwxr-xr-x+ 2 1001 1001 40 Mar 14 08:14 test-long-dir
-rw-r--r-- 1 1001 1001  0 Mar 14 08:14 test-long-file
---- test_ls::test_ls_long_formats stdout ----
touch: /tmp/.tmpCHVj2X/test-long-formats
run: /home/runner.linux/work/target/debug/coreutils ls -l --author test-long-formats
thread 'test_ls::test_ls_long_formats' panicked at tests/by-util/test_ls.rs:1514:10:
Stdout does not match regex:
-rw-r--r--+ 1 runner runner runner 0 Mar 14 08:14 test-long-formats
failures:
    test_ls::test_ls_color_norm
    test_ls::test_ls_inode
    test_ls::test_ls_long_format
    test_ls::test_ls_long_formats
```
2025-03-14 11:54:52 +01:00
Daniel Hofstetter
33a34e4e54 ls,wc: remove unnecessary unsafe blocks 2025-03-11 17:17:15 +01:00
Daniel Hofstetter
df4dfea852 tests: replace run() with succeeds() or fails() 2025-03-09 16:53:56 +01:00
Sylvestre Ledru
3e1adf40ee Use the new function 'fails_with_code' v2 2025-03-04 09:27:47 +01:00
Sylvestre Ledru
18cb7dcf9e Use the new function fails_with_code
Done with
```
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.no_stdout\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2)\n\1.no_stdout();/gs' *rs
$ sed -i -e "s|.fails()(.*).code_is(|.fails_with_code(|g" *rs
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2);/gs' *rs
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)(.*?)[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\3)\2;/gs' *rs
...
```
2025-03-01 17:26:20 +01:00
Jeffrey Finkelstein
ab6d95cdb9 ls: display %Z alphabetic time zone abbreviation
Display the alphabetic timezone abbreviation (like "UTC" or "CET") when
the `--time-style` argument includes a `%Z` directive. This matches the
behavior of `date`.

Fixes #7035
2025-01-18 09:33:52 -05:00
Daniel Hofstetter
e777db9304 ls: compile regexes outside of loop in tests 2025-01-10 07:42:13 +01:00
Sylvestre Ledru
6a8b766d6d
Merge pull request #7020 from jtracey/ls-nonunicode
ls: add better support for non-UTF-8 bytes
2025-01-02 11:16:58 +01:00
Sylvestre Ledru
958ac72113 ls: finish the plug of mtime
Will help with tests/ls/ls-time
2024-12-31 18:14:41 +01:00
Justin Tracey
b0837a0ca5
ls: add better support for non-UTF-8 bytes 2024-12-28 22:27:22 -05:00
Sylvestre Ledru
9a97c18877 ls: when a file has capabilities (setcap), change the color
Should fix tests/ls/capability.sh
2024-12-22 16:17:05 +01:00
Sylvestre Ledru
c0840dd43f clippy: unneeded 'return' statement 2024-11-29 08:36:54 +01:00
Dorian Péron
758b103c70 test(ls): Add test for #6554 2024-10-15 11:11:23 +02:00
David Campbell
353eb53367
Fix clippy::uninlined_format_args . 2024-09-19 17:56:27 -04:00
sreehari prasad
7887b76dab
ls: bump lscolors version (#6537)
when one suffix is specified more than once with different cases and with different styles, then ls would only do a case-sensitive matching.
2024-08-19 18:07:28 +02:00
Ben Wiederhake
42b3baf32f clippy: simplify code according to nightly 'needless_borrows_for_generic_args' lint
https://rust-lang.github.io/rust-clippy/master/index.html#/needless_borrows_for_generic_args
2024-07-18 15:59:36 +02:00
Laurent Cheylus
008dd38a0d
tests: fix warnings on OpenBSD for unused imports in by-util/test_*
Signed-off-by: Laurent Cheylus <foxy@free.fr>
2024-07-06 22:45:10 +02:00
Laurent Cheylus
00cca34a9c
tests: disable failed tests for ls on OpenBSD
Signed-off-by: Laurent Cheylus <foxy@free.fr>
2024-07-06 22:29:17 +02:00
Daniel Hofstetter
8cc129cff8
Merge pull request #6528 from sylvestre/cf
ls: when -CF is passed, use a tab. closes: #5396
2024-07-05 10:38:31 +02:00
Pyokyeong Son
ea478c2bb6
ls: fixed dired option (-D) not outputting datetime and parent dir byte offsets (#6538)
Closes #6522
2024-07-05 09:59:41 +02:00
Mengsheng Wu
1e80d3e3b2
ls: fix error sub dir output (#6521)
Closes #6492
2024-07-05 08:16:16 +02:00
Sylvestre Ledru
fd2c4a14b8 ls: when -CF is passed, use a tab. closes: #5396 2024-07-04 23:39:03 +02:00
n4n5
e506927f1f
ls: add test 2024-07-02 22:40:06 +02:00
Sylvestre Ledru
9c0f2f84ab
Merge pull request #6505 from Its-Just-Nans/fix-clippy-errors
Fix clippy errors
2024-06-30 18:55:51 +02:00
n4n5
ab67947321
fix clippy tests 2024-06-30 16:27:08 +02:00
sreehari prasad
dbeae9f444
ls: gnu color-clear-to-eol fix (#6507)
---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2024-06-29 10:06:00 +02:00
sreehari prasad
92665144c9
ls: gnu color-norm test fix (#6481) 2024-06-24 21:38:10 +02:00
Sylvestre Ledru
ececddd672 ls: If we have --dired --hyperlink, we don't show dired but we still want to see the
long format

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-06-24 10:27:37 +02:00
Sylvestre Ledru
4d705621e6 ls: --format will override the --dired option
Closes: #6488

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-06-23 21:13:37 +02:00