coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

uucore: format: num_format: add `fmt` function tests, and workaround 0e10 printing.

Open drinkcat opened this issue 7 months ago • 1 comments

Stacks on top of #7458, I didn't want to change too much there.


uucore: format: num_format: add fmt function tests

All the other tests directly called format_float_* functions, bypassing the additional logic in fmt (negative numbers, padding, etc.).

This also tests the parse function in mod.rs, which calls back into try_from_spec here. This also makes it easier to test a lot of different format combinations without having to do end-to-end tests in test_printf.rs.

Also add broken tests for the issues in #7509 and #7510.

uucore: format: Workaround BigDecimal printing bug with 0

This is a bigdecimal issue, see https://github.com/akubera/bigdecimal-rs/issues/144 .

drinkcat avatar Mar 20 '25 19:03 drinkcat