From 6dae1687b5fd4dd7ee104079da0df906fe393263 Mon Sep 17 00:00:00 2001 From: Marco Paland Date: Fri, 14 Sep 2018 13:48:27 +0200 Subject: fix(printf): fix negative argument precision Fixes #25 --- test/test_suite.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') diff --git a/test/test_suite.cpp b/test/test_suite.cpp index 05b95f7..e693851 100644 --- a/test/test_suite.cpp +++ b/test/test_suite.cpp @@ -1226,6 +1226,9 @@ TEST_CASE("misc", "[]" ) { test::sprintf(buffer, "%.*f", 2, 0.33333333); REQUIRE(!strcmp(buffer, "0.33")); + test::sprintf(buffer, "%.*d", -1, 1); + REQUIRE(!strcmp(buffer, "1")); + test::sprintf(buffer, "%.3s", "foobar"); REQUIRE(!strcmp(buffer, "foo")); -- cgit v1.2.3