From 2634a30499a6000b67efdc15de8143fe82343f8a Mon Sep 17 00:00:00 2001 From: Eyal Rozenberg Date: Tue, 12 Dec 2023 14:47:40 +0200 Subject: [PATCH] Regards #156: Add testcase for the expected correct behavior for `printf("%# 01.1g",, 9.8)` --- test/test_suite_main_testcases.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_suite_main_testcases.hpp b/test/test_suite_main_testcases.hpp index 0615b47..251b1a6 100644 --- a/test/test_suite_main_testcases.hpp +++ b/test/test_suite_main_testcases.hpp @@ -826,6 +826,7 @@ PRINTF_TEST_CASE(floating_point_specifiers_precision_and_flags) PRINTING_CHECK("-4e+04", ==, sprintf_, buffer, "%.1g", -40661.5); PRINTING_CHECK("-4.e+04", ==, sprintf_, buffer, "%#.1g", -40661.5); PRINTING_CHECK("100.", ==, sprintf_, buffer, "%#.3g", 99.998580932617187500); + PRINTING_CHECK("1.e01", ==, sprintf_, buffer, "%# 01.1g", 9.8); // Note: The following value is _barely_ normal; make the mantissa 1.1 and it loses its normality. PRINTING_CHECK("1.2345678901e-308", ==, sprintf_, buffer, "%.10e", 1.2345678901e-308); // Rounding-focused checks