format: test case whitespace

This commit is contained in:
Danny Robson 2016-01-20 16:39:20 +11:00
parent c877192cfc
commit 0fd72f0893

View File

@ -13,9 +13,17 @@ main (void)
tap.expect_eq (util::format::render ("%s", "identity"s), "identity"s, "identity string substitution");
tap.expect_eq (util::format::render ("%s", "identity" ), "identity"s, "identity char[] substitution");
tap.expect_throw<util::format::missing_error> ([] (void) { util::format::render ("%s"); }, "missing value");
tap.expect_throw<util::format::format_error> ([] (void) { util::format::render ("%!", 42); }, "invalid specifier");
tap.expect_throw<util::format::format_error> ([] (void) { util::format::render ("%", 42); }, "truncated specifier");
tap.expect_throw<util::format::missing_error> ([] (void) {
util::format::render ("%s");
}, "missing value");
tap.expect_throw<util::format::format_error> ([] (void) {
util::format::render ("%!", 42);
}, "invalid specifier");
tap.expect_throw<util::format::format_error> ([] (void) {
util::format::render ("%", 42);
}, "truncated specifier");
return tap.status ();
}