Added vsnprintf implementation.

This commit is contained in:
Branimir Karadžić
2017-02-04 22:27:49 -08:00
parent 273dc78136
commit 89248e2874
4 changed files with 429 additions and 29 deletions

View File

@@ -52,3 +52,17 @@ TEST_CASE("vsnprintf f", "")
REQUIRE(test("13.370 ", "%-8.3f", 13.37) );
REQUIRE(test("13.370 ", "%*.*f", -8, 3, 13.37) );
}
TEST_CASE("vsnprintf d/u/x", "")
{
REQUIRE(test("1337", "%d", 1337) );
REQUIRE(test("1337", "%x", 0x1337) );
}
TEST_CASE("vsnprintf", "")
{
REQUIRE(test("x", "%c", 'x') );
REQUIRE(test("hello, world!", "%s, %s!", "hello", "world") );
}