[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ls/test: verify the output of ls --dired
From: |
Pádraig Brady |
Subject: |
Re: ls/test: verify the output of ls --dired |
Date: |
Fri, 15 Sep 2023 13:53:50 +0100 |
User-agent: |
Mozilla Thunderbird |
On 14/09/2023 23:05, Sylvestre Ledru wrote:
Hello
Currently, GNU coreutils doesn't have any test verifying the actual
output of ls --dired.
It should generate a list of position (pairs).
//DIRED// 73 82 142 152 ...
The attached patch creates 2 files and one directory and verify that we
can find their names using the position.
Well the existing test did verify --dired output offsets,
albeit constant offsets from the non varying output.
Your tests is a bit more thorough in that it
checks files with varying offsets.
I'll apply the attached in your name later,
which has the following adjustments:
- Uses "tests:" prefix in summary, as we're not changing ls logic
- Keeps lines < 80 chars wide
- Uses more functional style where possible as more concise/natural in shell
- Uses more portable $(($i + 1)) rather than $((i + 1)
- Simplifies main loop by leveraging shell `set -- ...` param handling
- Uses multibyte char in a file name for informative reasons
- Removes redundant LC_MESSAGES=C since we're handling varying output anyway
- Avoids use of awk, which is overkill for this use case
cheers,
Pádraig
ls-dired-test.patch
Description: Text Data