Commit graph

205 commits

Author SHA1 Message Date
Daniel Hofstetter
d8709d2839 ls: recognize BLOCKSIZE env var 2023-12-19 15:00:06 +01:00
Daniel Hofstetter
a5606613bd ls: ignore invalid block size from env vars 2023-12-19 10:02:34 +01:00
Daniel Hofstetter
917c6a4743 ls: support hyperlinks for dir names 2023-12-18 15:26:09 +01:00
Sylvestre Ledru
0fa074fcba
Merge pull request #5629 from cakebaker/ls_hyperlink_encode
ls: encode path when using --hyperlink
2023-12-18 13:38:08 +01:00
Sylvestre Ledru
f6d3f9afbf ls: manages the COLOR and COLORTERM variables
Should fix GNU tests/ls/color-term.sh
2023-12-16 09:50:37 +01:00
Daniel Hofstetter
42558344f1 ls: enable "args override self" 2023-12-12 14:23:51 +01:00
Daniel Hofstetter
89cb4acb99 ls: encode path when using --hyperlink 2023-12-12 10:03:55 +01:00
Daniel Hofstetter
6711dd5694 ls: make --block-size and --human-readable/--si
override each other
2023-12-11 16:38:55 +01:00
Sylvestre Ledru
4442b35370
Merge pull request #5626 from cakebaker/ls_invalid_block_size
ls: handle invalid block size as GNU does
2023-12-11 07:49:38 +01:00
Dorian Péron
673093f842
ls: set default quoting style to literal when not TTY (#5553)
* ls: set default quoting style to literal if output is not TTY

* tests/ls: Fix quoting tests that now run with Literal as default

* ls: Fix formatting/linting/spelling issues

* tests/ls: Fix windows escaped tests
2023-12-10 16:07:41 +01:00
Sylvestre Ledru
1d4c919b97
Add mdir to the spell ignore 2023-12-09 16:33:19 +01:00
Sylvestre Ledru
e071286eb0 address review comments 2023-12-09 13:10:41 +01:00
Sylvestre Ledru
268b180416 ls colors: create a stylemanager to carry the previous style to know if we need to reset or not 2023-12-09 13:10:38 +01:00
Sylvestre Ledru
b676216f9b ls: use the gnu_legacy feature from lscolors 2023-12-09 13:05:12 +01:00
Daniel Hofstetter
e9dc2930ee ls: handle invalid block size as GNU does 2023-12-08 19:19:51 +01:00
Daniel Hofstetter
5a32ab8004 ls: implement --hyperlink 2023-12-07 08:14:25 +01:00
Daniel Hofstetter
51fc2d7564 ls: ignore value of POSIXLY_CORRECT 2023-12-03 16:01:19 +01:00
Daniel Hofstetter
0ec6802459 ls: fix padding of size column when using -l 2023-11-30 16:19:27 +01:00
Daniel Hofstetter
2f9fcf73fa clippy: fix warnings introduced by Rust 1.74 2023-11-16 16:21:28 +01:00
Terts Diepraam
96d0830952
Merge pull request #5446 from cakebaker/ls_try_get_matches_from
ls: use try_get_matches_from instead of get_matches_from
2023-10-25 11:25:40 +02:00
Daniel Hofstetter
6f84e56e28 ls: return exit code 2 for invalid time-style 2023-10-24 16:33:04 +02:00
Daniel Hofstetter
fd18d2686f ls: return exit code 2 for -l --dired --zero 2023-10-24 14:48:24 +02:00
Sylvestre Ledru
f971a69d69
ls --dired -R: fix the positions (#5341)
* 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-19 14:17:34 +02:00
Sylvestre Ledru
41188a915e
rename the test
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2023-10-13 11:35:45 +02:00
Sylvestre Ledru
94972d45c7 ls: Document a bit tests/ls/stat-dtype.sh 2023-10-12 23:37:07 +02:00
Sylvestre Ledru
7337cd5169 ls -R1: add a test to replicate GNU's recursive.sh 2023-10-01 17:03:57 +02:00
Daniel Hofstetter
0794d1338d ls: fix test which fails if /tmp uses tmpfs 2023-09-22 10:43:23 +02:00
Sylvestre Ledru
9b4d2c6bc4
ls: implement --dired
* 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-20 08:17:46 +02:00
Sylvestre Ledru
37ee889003 ls -l: show an error when symlink not readable
switching to match and handle the error

Will help with tests/ls/stat-failed.sh
2023-09-15 22:34:17 +02:00
Sylvestre Ledru
bfca6bf70f Add license headers on all files 2023-08-21 10:49:27 +02:00
Rayhan Faizel
9e26534239 tests/ls: Test overflowing decimal and octal values of --width 2023-07-12 23:24:26 +05:30
John Shin
4db5a60667 ls: add back version cmp test 2023-07-09 15:30:56 -07:00
Daniel Hofstetter
0b37b63ea3
Merge pull request #5055 from yt2b/ls_literal_option
ls: --l should output the same as --literal
2023-07-09 14:07:24 +02:00
yt2b
cf6f7856e4 ls: fix --l option 2023-07-08 10:43:20 +09:00
John Shin
b42a5b8741 ls: update test result for version compare 2023-07-05 10:05:52 +02:00
Guillaume Ranquet
80c7ed9732 ls: force fetching metadata when called with -L -Z
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-26 14:46:56 +02:00
Daniel Hofstetter
c26396087f
ls: add words to spell-checker:ignore 2023-06-06 17:44:04 +02:00
Rayhan Faizel
21f1a119c3 tests/ls: Implement tests for sort by width option 2023-06-06 20:56:42 +05:30
Sylvestre Ledru
3e7594632b ls: when facing an invalid utf-8, don't panic
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-14 22:11:44 +02:00
Daniel Hofstetter
98fa941250
Merge pull request #4759 from sylvestre/clippy4
fix some clippy warnings in tests
2023-05-12 07:15:44 +02:00
SteveLauC
452be5a220
ls: device number for BSDs and solarishOS (#4841) 2023-05-11 12:58:36 +02:00
Niyaz Nigmatullin
467cbf30de [tests/ls] Support user names containing dots
- Fix regex's in tests for `ls -l`
2023-04-27 18:27:48 +03:00
Dan Gohman
eba000ddcc Use expected_result in test_ls to avoid spurious failures
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-25 05:40:37 -07:00
Sylvestre Ledru
efa361dd7c Fix some trivial clippy warnings 2023-04-20 23:22:05 +02:00
Daniel Hofstetter
7a888da409 tests: remove all "extern crate" statements 2023-04-10 08:31:31 +02:00
Piotr Kwiecinski
51d39c8bb7 test_ls: cannot find function expected_result in this scope 2023-03-23 09:18:17 +01:00
Daniel Hofstetter
6988eb7ec6 tests: expand wildcard imports 2023-03-20 15:32:35 +01:00
Parag Jain
50e019a711 Fixing failing test locally because of missing case sensitivity handling 2023-03-14 12:28:49 -04:00
Thayne McCombs
17f9507e17 Add tests for non-utf8 2023-02-21 22:58:39 -07:00
Joining7943
f610f33aa7
tests/util: Don't trim output in CmdResult::stdout_matches and 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-02-16 15:33:33 +01:00