aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMarco Paland <marco@paland.com>2018-09-24 15:13:41 +0200
committerMarco Paland <marco@paland.com>2018-09-24 15:13:41 +0200
commit00f2525d1a712c80c2f2b5ffa648e44fbc29ee05 (patch)
tree884f4378f7cf78f9f67633118109c40e4ffbbe99 /test
parent25958b9beb1830eb79033d6095a64f4c5f87effa (diff)
downloadprintf-00f2525d1a712c80c2f2b5ffa648e44fbc29ee05.tar.gz
printf-00f2525d1a712c80c2f2b5ffa648e44fbc29ee05.tar.bz2
printf-00f2525d1a712c80c2f2b5ffa648e44fbc29ee05.zip
feat(printf): add # flag support for %b specifier
Closes #29
Diffstat (limited to 'test')
-rw-r--r--test/test_suite.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/test_suite.cpp b/test/test_suite.cpp
index 45f1abe..272f4c4 100644
--- a/test/test_suite.cpp
+++ b/test/test_suite.cpp
@@ -352,6 +352,10 @@ TEST_CASE("# flag", "[]" ) {
test::sprintf(buffer, "%#.0x", 0);
REQUIRE(!strcmp(buffer, ""));
+ test::sprintf(buffer, "%#.8x", 0x614e);
+ REQUIRE(!strcmp(buffer, "0x0000614e"));
+ test::sprintf(buffer,"%#b", 6);
+ REQUIRE(!strcmp(buffer, "0b110"));
}