See #7542, it's not totally clear where the problem comes from,
but blanking LD_PRELOAD set by termux seems to fix the problem
(but introduces other issues.
Let's just disable these tests for now.
For some unclear reason, Android _now_ sometimes returns an
IsADirectory error, instead of PermissionDenied, when trying
to execute `.`.
Since this test really wants to test PermissionDenied, we try
to execute a file in the fixture instead, that doesn't have
exec permission.
Also, limit this test to Unix.
Fixes part of #7542.
On Android CI, `sh` would point at a different flavor of shell
shipped with termux (dash).
The current umask test expects that `/system/bin/sh` is used though,
so create a new function TestScenario:cmd_shell that runs a command
in the default shell (that could be used in more tests).
Fixes one part of #7542.
Some of these tests are not completely defined behavior, but
in many cases they make sense (or at least one can find some
consistent logic to it).
However, there are 2 edge cases that are more dubious IMHO.
One of them has been reported on list a while back, and I
just reported another.
Tests for both `seq` and `yes` run a command that never terminates,
and check the beggining of their output in stdout, move the copied
parts of the wrapper function to common/util.
We still need to use slightly different logic to parse exit value
as `seq` returns success if stdout gets closed, while `yes` fails.
* Add test to ensure arch output is not empty
This test ensures that the output of the arch command is non-empty, which is a minimal expectation across all supported architectures.
This helps avoid regressions or edge cases where the command might unexpectedly return an empty string on unsupported or misconfigured platforms.
* Update tests/by-util/test_arch.rs
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
* Apply cargo fmt formatting
---------
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
* Create failing test for #7455
Also update existing test to ensure output is empty.
* add ignore until relevant issue is fixed
---------
Co-authored-by: M Bussonnier <mbussonnier@gmail.com>
- shuf now uses OS strings, so it can read from filenames that are
invalid Unicode and it can shuffle arguments that are invalid
Unicode. `uucore` now has an `OsWrite` trait to support this without
platform-specific boilerplate.
- shuf no longer tries to split individual command line arguments,
only bulk input from a file/stdin. (This matches GNU and busybox.)
- More values are parsed inside clap instead of manually, leading to
better error messages and less code.
- Some code has been simplified or made more idiomatic.
When using `touch -t` with a 2 digit year, the year is interpreted as
a relative year to 2000.
When the year is 68 or less, it should be interpreted as 20xx.
When the year is 69 or more, it should be interpreted as 19xx.
This is the behavior of GNU `touch`.
fixes gh-7280
Arguably 2 digits years should be deprecated as we
are already closer to 2069, than 1969.
Following clippy advice:
error: this `map_or` can be simplified
--> tests\common\util.rs:411:9
|
411 | self.exit_status.map_or(true, |e| e.success())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_none_or instead: `self.exit_status.is_none_or(|e| e.success())`
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.