1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

uucore: format: Fix hexadecimal default format print

The default hex format, on x86(-64) prints 15 digits after the
decimal point, _but_ also trims trailing zeros, so it's not just
a simple default precision and a little bit of extra handling is
required.

Also add a bunch of tests.

Fixes #7364.
This commit is contained in:
Nicolas Boichat 2025-03-25 11:18:57 +01:00
parent 3f24796c8d
commit 8cf4da0b19
2 changed files with 72 additions and 16 deletions

View file

@ -390,7 +390,6 @@ fn sub_num_sci_negative() {
.stdout_only("-1234 is -1.234000e+03");
}
#[cfg_attr(not(feature = "test_unimplemented"), ignore)]
#[test]
fn sub_num_hex_float_lower() {
new_ucmd!()
@ -399,7 +398,6 @@ fn sub_num_hex_float_lower() {
.stdout_only("0xep-4");
}
#[cfg_attr(not(feature = "test_unimplemented"), ignore)]
#[test]
fn sub_num_hex_float_upper() {
new_ucmd!()