summaryrefslogtreecommitdiffstats
path: root/tests/by-util/test_ls.rs
AgeCommit message (Collapse)Author
2022-07-31ls: Implement --zero flag. (#2929) (#3746)Pierre Marsais
* ls: Implement --zero flag. (#2929) This flag can be used to provide a easy machine parseable output from ls, as discussed in the GNU bug report https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49716. There are some peculiarities with this flag: - Current implementation of GNU ls of the `--zero` flag implies some other flags. Those can be overridden by setting those flags after `--zero` in the command line. - This flag is not compatible with `--dired`. This patch is not 100% compliant with GNU ls: GNU ls `--zero` will fail if `--dired` and `-l` are set, while with this patch only `--dired` is needed for the command to fail. We also add `--dired` flag to the parser, with no additional behaviour change. Testing done: ``` $ bash util/build-gnu.sh [...] $ bash util/run-gnu-test.sh tests/ls/zero-option.sh [...] PASS: tests/ls/zero-option.sh ============================================================================ Testsuite summary for GNU coreutils 9.1.36-8ec11 ============================================================================ # TOTAL: 1 # PASS: 1 # SKIP: 0 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 ============================================================================ ``` * Use the US way to spell Behavior * Fix formatting with cargo fmt -- tests/by-util/test_ls.rs * Simplify --zero flag overriding logic by using index_of Also, allow multiple --zero flags, as this is possible with GNU ls command. Only the last one is taken into account. Co-authored-by: Sylvestre Ledru <sledru@mozilla.com>
2022-07-26ls: silently ignore `-T` option (#3718)Sam Nystrom
* ls: silently ignore `-T` option
2022-07-13Merge pull request #3704 from Sciencentistguy/once_cellSylvestre Ledru
Replace lazy_static with once_cell
2022-07-12Replace lazy_static with once_cellJamie Quigley
2022-07-11ls: add already listed message (#3707)Niyaz Nigmatullin
* ls: handle looping symlinks infinite printing * ls: better coloring and printing symlinks when dereferenced * tests/ls: add dereferencing and symlink loop tests * ls: reformat changed using rustfmt * ls: follow clippy advice for cleaner code * uucore/fs: fix FileInformation to open directory handles in Windows as well
2022-06-13Add a test like the one in the issue.anastygnome
Signed-off-by: anastygnome <noreplygitemail@protonmail.com>
2022-06-12Correctly parse numbers starting with 0 as octalJoerg Jaspert
2022-06-11Test for (against) octal-looking widthJoerg Jaspert
2022-06-03ls: fix double quoting when color is enabledTerts Diepraam
When color was enabled the escape_name function was called twice which led to names like `hello world` being displayed as `"'hello world'".
2022-05-21tests/ls: add --group-directories-first testThomas Queiroz
2022-05-21tests/ls: update version sort testThomas Queiroz
2022-05-13all: clippy fixesJeffrey Finkelstein
2022-04-20get android builds to compile and pass testsJustin Tracey
2022-04-09Merge pull request #3343 from uutils/dependabot/cargo/lscolors-0.9.0Sylvestre Ledru
build(deps): bump lscolors from 0.7.1 to 0.9.0
2022-04-07fix regressed test due to lscolors updateTerts Diepraam
2022-04-05all: use array intoiteratorTerts Diepraam
2022-03-27ls: add support for --quoting-style=shell-escape b --color=autoSylvestre Ledru
2022-03-27ls: Add missing quote with --quoting-style=shell-escapeSylvestre Ledru
Should fix GNU: tests/ls/symlink-quote.sh
2022-03-21 ls: support multiple -a or -ASylvestre Ledru
2022-03-20ls: when -aA are provided, the order mattersSylvestre Ledru
2022-03-15ls: Fix display of inodes and add allocation size feature (#3052)kimono-koans
2022-02-25fix Rust 1.59 clippy lintsTerts Diepraam
2022-02-15Merge pull request #3003 from tertsdiepraam/ls-fix-another-flaky-testSylvestre Ledru
`ls`: fix flaky test `test_ls_io_errors`
2022-02-10ls: add new optional arguments to --classify flag (#3041)Abhishek C Sharma
* ls: add new optional arguments to --classify flag The --classify flag in ls now takes an option when argument that may have the values always, auto and none. Modified clap argument to allow an optional parameter and changed the classify flag value parsing logic to account for this change. * ls: add test for indicator-style, ind and classify with value none * ls: require option paramter to --classify to use a = to specify flag value * ls: account for all the undocumented possible values for the --classify flag Added the other values for the --classify flag along with modifications to tests. Also documented the inconsistency between GNU coreutils because we accept the flag value even for the short version of the flag.
2022-02-02test_ls: Do not rely on the system time of metadata'access timeHanif Bin Ariffin
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.43262@gmail.com>
2022-02-01ls: fix flaky test test_ls_io_errorsTerts Diepraam
2022-01-31Merge pull request #2970 from tertsdiepraam/ls-fix-flaky-testSylvestre Ledru
`ls`: fix flaky test
2022-01-30ls: fix flaky test (#2969)Terts Diepraam
2022-01-30use semicolons if nothing returnedDaniel Eades
2022-01-30Merge pull request #2875 from kimono-koans/ls_bad_fd_2Sylvestre Ledru
ls: Fix display of bad file descriptor errors
2022-01-29add some tests for Clap's InferLongArgs settingTerts Diepraam
2022-01-27Fix broken test in certain Linux containerselectricboogie
2022-01-21ls: fix clippy lints in testsJustin Tracey
2022-01-18ls: fix tests for windowsTerts Diepraam
2022-01-17Add new test, never print error on deref-ed bad fdelectricboogie
2022-01-16Use dir_entry metadata for dereferenced bad fds to match GNU, add comments, ↵electricboogie
clippy lints
2022-01-15Fix display of bad fd errorselectricboogie
2022-01-15ls: Fix device display (#2855)kimono-koans
2022-01-11ls: Fix padding for dangling links in non-Long formats (#2856)kimono-koans
* Fix padding for dangling links in non-long formats Co-authored-by: electricboogie <32370782+electricboogie@users.noreply.github.com>
2022-01-09Merge pull request #2854 from kimono-koans/ls_fix_errno_1Sylvestre Ledru
ls: Fix Errno 1, print errors at the md call point
2022-01-10ls: On Windows use DirEntry#metadata() instead of fs::metadatamoko256
2022-01-08Add test for double printing dangling link errorselectricboogie
2022-01-07Merge branch 'uutils:master' into ls_fix_errno_1kimono-koans
2022-01-07Fix Windows test(?): inode request shouldn't error on Windows, b/c there are ↵electricboogie
no inodes
2022-01-06Fix test dir names for Windowselectricboogie
2022-01-06Fix newline when only dirs in base directory, and testelectricboogie
2022-01-05ls: Improve error handling and other improvements (#2809)kimono-koans
* print error in the correct order by flushing the stdout buffer before printing an error * print correct GNU error codes * correct formatting for config.inode, and for dangling links * correct padding for Format::Long * remove colors after the -> link symbol as this doesn't match GNU * correct the major, minor #s for char devices, and correct padding * improve speed for all metadata intensive ops by not allocating metadata unless in a Sort mode * new tests, have struggled with how to deal with stderr, stdout ordering in a test though * tried to implement UIoError, but am still having issues matching the formatting of GNU Co-authored-by: electricboogie <32370782+electricboogie@users.noreply.github.com>
2021-12-22ls: Reduce binary size of ls by removing regex crate (#2781)kimono-koans
2021-09-17Merge branch 'master' into ls_selinuxJan Scheer
2021-09-13Merge pull request #2651 from jhscheer/ls_small_fix_for_test_from_2627Michael Debertol
test_ls: add features for uutils called by ccmd