Floating hex format is supposed to be `[-]0xh.hhhp±d`. Note that
the exponent is a decimal value, not an hex number: fix that.
Also, add basic tests for this format, while we're at it.
Test: `cargo test --package uucore --all-features float`
Fixes#7362.
Fix issue #7028
Head tool now ensures that stdin is set to the last character
that was output by the tool. This ensures that if any subsequent
tools are run from the same input stream they will start at the
correct point in the stream.
* test: add < and > operators for string comparison
Fixes#7254.
* Add more tests for string inequality
* Use match in place of if/elseif block
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
* Change test name to specify lt/gt operator
---------
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Change the prompt when attempting to remove an inaccessible
directory. Before this commit, the prompt was
rm: remove write-protected directory 'dir'?
After this commit, the prompt is
rm: attempt removal of inaccessible directory 'dir'?
This required slightly adjusting the logic for which prompt messages to
display under which circumstances.
Fixes#7309.
Change the implementation of `rm -r` so that it is explicitly recursive
so that (1) there is one code path regardless of whether `--verbose` is
given and (2) it is easier to be compatible with GNU `rm`.
This change eliminates a dependency on the `walkdir` crate.
Fixes#7033, fixes#7305, fixes#7307.
Check the user write permission directly from the mode instead of using
the `Permissions::readonly()` method. This seems to more closely match
the behavior of GNU `rm`.
`[` alone is not a valid test command.
`test` alone is a valid test command.
`]` alone is not a valid test command.
Update usage string to match GNU behavior.
* cp: fix verbose output order after prompt
Fixes: #7285
* cp: add test for verbose message order
* cp: fix test for interactive prompt ordering
* cp: update test for verbose output order
* cp: fix test cases to use update option
Avoid a panic that would occur when attempting to remove a file that
didn't exist. This would happen when scanning for a regular expression
match, advancing by a positive offset, and suppressing empty files. For
example, before this commit,
echo a | csplit -z - %a%1
would cause a panic. After this commit, the process terminates as
expected: without error, without output, and without any files written.
Fixes#7251.