unit-tests: Check printing of strings having zero length

This commit is contained in:
Martin Willi 2013-10-25 14:41:28 +02:00
parent 61934203e2
commit d9d0eef92b
1 changed files with 2 additions and 0 deletions

View File

@ -48,6 +48,8 @@ START_TEST(test_printf_strings)
verify("a bc def", "%s %s %s", "a", "bc", "def");
verify("asd", "%.3s", "asdfg");
verify("asdf", "%.*s", (int)4, "asdfg");
verify("", "%.0s", NULL);
verify("", "%.*s", (int)0, NULL);
verify(" asdf", "%6s", "asdf");
verify(" asdf", "%+6s", "asdf");
verify("asdf ", "%-6s", "asdf");