summaryrefslogtreecommitdiffstats
path: root/tests/by-util/test_ls.rs
AgeCommit message (Collapse)Author
2023-11-30ls: fix padding of size column when using -lDaniel Hofstetter
2023-11-16clippy: fix warnings introduced by Rust 1.74Daniel Hofstetter
2023-10-25Merge pull request #5446 from cakebaker/ls_try_get_matches_fromTerts Diepraam
ls: use try_get_matches_from instead of get_matches_from
2023-10-24ls: return exit code 2 for invalid time-styleDaniel Hofstetter
2023-10-24ls: return exit code 2 for -l --dired --zeroDaniel Hofstetter
2023-10-19ls --dired -R: fix the positions (#5341)Sylvestre Ledru
* move get_offset_from_previous_line into a specific function * dired: improve the -R support * dired: fix the display with subdir * ls --dired -R: fix the positions * ls --dired -R: verify also the SUBDIRED coordinate * ls --dired -R: add a long file name and fix a windows test * dired: always put dired first in the args + minor fixes Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com> * ls: add cognitive_complexity to silent a warning --------- Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2023-10-13rename the testSylvestre Ledru
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2023-10-12ls: Document a bit tests/ls/stat-dtype.shSylvestre Ledru
2023-10-01ls -R1: add a test to replicate GNU's recursive.shSylvestre Ledru
2023-09-22ls: fix test which fails if /tmp uses tmpfsDaniel Hofstetter
2023-09-20ls: implement --diredSylvestre Ledru
* Support ls --dired * stat-failed.sh: update of the test - we have a small difference * ls --dired: address some of the comments * fix warnings * use unwrap() * Improve test Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com> * Simplify test Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com> * Remove a word from the spell ignore Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com> * remove duplication of the spell ignore Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com> * rustfmt --------- Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2023-09-15ls -l: show an error when symlink not readableSylvestre Ledru
switching to match and handle the error Will help with tests/ls/stat-failed.sh
2023-08-21Add license headers on all filesSylvestre Ledru
2023-07-12tests/ls: Test overflowing decimal and octal values of --widthRayhan Faizel
2023-07-09ls: add back version cmp testJohn Shin
2023-07-09Merge pull request #5055 from yt2b/ls_literal_optionDaniel Hofstetter
ls: --l should output the same as --literal
2023-07-08ls: fix --l optionyt2b
2023-07-05ls: update test result for version compareJohn Shin
2023-06-26ls: force fetching metadata when called with -L -ZGuillaume Ranquet
The metadata are not used but it permits to check the symlink is valid. We then return 1 on invalid symlinks when ls is invoked with ls -L -Z Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
2023-06-06ls: add words to spell-checker:ignoreDaniel Hofstetter
2023-06-06tests/ls: Implement tests for sort by width optionRayhan Faizel
2023-05-14ls: when facing an invalid utf-8, don't panicSylvestre Ledru
Fails with ``` thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "invalid-\xE0-"', src/uu/ls/src/ls.rs:1932:53 ```
2023-05-12Merge pull request #4759 from sylvestre/clippy4Daniel Hofstetter
fix some clippy warnings in tests
2023-05-11ls: device number for BSDs and solarishOS (#4841)SteveLauC
2023-04-27[tests/ls] Support user names containing dotsNiyaz Nigmatullin
- Fix regex's in tests for `ls -l`
2023-04-25Use `expected_result` in test_ls to avoid spurious failuresDan Gohman
As the existing comment says, the expected output here is dependent on the platform, so use the `expected_result` utility to avoid hard-coding specific results for each platform. This fixes spurious failures on my machine.
2023-04-20Fix some trivial clippy warningsSylvestre Ledru
2023-04-10tests: remove all "extern crate" statementsDaniel Hofstetter
2023-03-23test_ls: cannot find function `expected_result` in this scopePiotr Kwiecinski
2023-03-20tests: expand wildcard importsDaniel Hofstetter
2023-03-14Fixing failing test locally because of missing case sensitivity handlingParag Jain
2023-02-21Add tests for non-utf8Thayne McCombs
2023-02-16`tests/util`: Don't trim output in `CmdResult::stdout_matches` and ↵Joining7943
`stdout_does_not_match` (#4304) * tests/util: Fix documentation of UCommand::stderr_only and usage_error * tests/util: Remove trimming from CmdResult::stdout_matches and stdout_does_not_match. Fix tests. The tests are fixed to match the trailing newline instead of ignoring it.
2023-01-27clippy: fix warnings introduced with Rust 1.67.0Daniel Hofstetter
2023-01-22tests/util: Do not trim stderr in CmdResult::stderr_is. Add method ↵Joining7943
stderr_trimmed_is. Fix tests assert whitespace instead of trimming it. Disable some tests in `test_tr` because `tr` produces too many newlines.
2022-12-01chore: standardize creation of empty stringsDaniel Hofstetter
2022-11-16chore: run `cargo +nightly clippy --fix`Niyaz Nigmatullin
2022-10-23clippy fixesJeffrey Finkelstein
2022-10-22Merge pull request #4014 from tertsdiepraam/ls-windows-permissionsSylvestre Ledru
`ls`, `stat`: Show more info in long format on Windows
2022-10-13ls: update to clap 4Terts Diepraam
2022-10-13Fix some clippy warningsSylvestre Ledru
Fixed with `cargo clippy --features unix --fix` and manually
2022-10-09Fix coding styleSylvestre Ledru
2022-10-09test_ls: adapt to new windows permissionsTerts Diepraam
2022-10-08ls: align --ignore behavior with that of GNU lsAckerley Tng
2022-10-05ls: add support for +FORMAT in timestyleDavid Matos
2022-09-21dd: custom positional argument parsingTerts Diepraam
2022-09-12tests/ls: added exit code to some test failuresNiyaz Nigmatullin
2022-08-20unix_sockets is deprecated, use std::os::unix::net insteadNiyaz Nigmatullin
2022-08-13tests: ignore failing tests for FreeBSD (#3778)Jan Scheer
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>