Relative links works on github but are broken for the 'CONTRIBUTING.md'
on the mdbook. This change the relative link to the full link that works
on github and on the mdbook
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.
* document how to do good performance work
* doc: spell, ignore "taskset"
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
---------
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
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.
In most common use cases:
- We can bypass a lot of `write_output` when width == 0.
- Simplify format_float_decimal when the input is an integer.
Also document another interesting case in src/uu/seq/BENCHMARKING.md.
Display hexadecimal floats with arbitrary precision.
Note that some of the logic will produce extremely large
BitInt as intermediate values: there is some optimization
possible here, but the current implementation appears to work
fine for reasonable numbers (e.g. whatever would previously
fit in a f64, and even with somewhat large precision).
No more f64 operations needed, we just trim (or extend) BigDecimal to
appropriate precision, get the digits as a string, then add the
decimal point.
Similar to what BigDecimal::write_scientific_notation does, but
we need a little bit more control.
Using an associated type in Formatter trait was quite nice, but, in
a follow-up change, we'd like to pass a _reference_ to the Float
Formatter, while just passing i64/u64 as a value to the Int
formatters. Associated type doesn't allow for that, so we turn
it into a generic instead.
This makes Format<> a bit more complicated though, as we need
to specify both the Formatter, _and_ the type to be formatted.
Will make it possible to directly print ExtendedBigDecimal in `seq`,
and gradually get rid of limited f64 precision in other tools
(e.g. `printf`).
Changes are mostly mechanical, we reexport ExtendedBigDecimal directly
in format to keep the imports slightly shorter.
* 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>
Issue #7494
Improve performace of wc app.
- Use the bytecount::num_chars API to count UTF-8 characters in a file.
- Enable runtime-dispatch-simd feature in the bytecount crate.