diff options
author | Marco Paland <marco@paland.com> | 2018-09-14 15:02:57 +0200 |
---|---|---|
committer | Marco Paland <marco@paland.com> | 2018-09-14 15:02:57 +0200 |
commit | 21a282a2a427cb33d12d1d31ae8aee14d9bbb8c3 (patch) | |
tree | 03e56c130318d2cb9398213c43b1d961495a722f /test | |
parent | 7075d314a0875caa45c8571f7aa52f732f3612a9 (diff) | |
download | printf-21a282a2a427cb33d12d1d31ae8aee14d9bbb8c3.tar.gz printf-21a282a2a427cb33d12d1d31ae8aee14d9bbb8c3.tar.bz2 printf-21a282a2a427cb33d12d1d31ae8aee14d9bbb8c3.zip |
fix(printf): ignore 0 flag for integers if precision is specified
Fixes #27
Diffstat (limited to 'test')
-rw-r--r-- | test/test_suite.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_suite.cpp b/test/test_suite.cpp index 99e07b7..45f1abe 100644 --- a/test/test_suite.cpp +++ b/test/test_suite.cpp @@ -934,6 +934,12 @@ TEST_CASE("length", "[]" ) { test::sprintf(buffer, "%20.X", 0U);
REQUIRE(!strcmp(buffer, " "));
+
+ test::sprintf(buffer, "%02.0u", 0U);
+ REQUIRE(!strcmp(buffer, " "));
+
+ test::sprintf(buffer, "%02.0d", 0);
+ REQUIRE(!strcmp(buffer, " "));
}
|