From 0822511fdcd00d95554601983c2d2e72becaa2ce Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Tue, 21 Nov 2023 16:49:20 +0100 Subject: [PATCH] test/printf: ignoring rounding up to 2 This is a limitation of the current implementation, which should ultimately use "long double" precision instead of f64. --- tests/by-util/test_printf.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/by-util/test_printf.rs b/tests/by-util/test_printf.rs index 875896a9f..dfd131590 100644 --- a/tests/by-util/test_printf.rs +++ b/tests/by-util/test_printf.rs @@ -296,9 +296,18 @@ fn sub_num_float_e_no_round() { } #[test] -fn sub_num_float_round() { +fn sub_num_float_round_to_one() { new_ucmd!() - .args(&["two is %f", "1.9999996"]) + .args(&["one is %f", "0.9999995"]) + .succeeds() + .stdout_only("one is 1.000000"); +} + +#[test] +#[ignore = "Requires 'long double' precision floats to be used internally"] +fn sub_num_float_round_to_two() { + new_ucmd!() + .args(&["two is %f", "1.9999995"]) .succeeds() .stdout_only("two is 2.000000"); }