too few, too many args
This commit is contained in:
parent
cdddf24f25
commit
db475f9e7e
|
@ -257,17 +257,28 @@ namespace nix {
|
|||
* hintfmt
|
||||
* --------------------------------------------------------------------------*/
|
||||
|
||||
TEST(hintfmt, withstandsPercentString) {
|
||||
TEST(hintfmt, percentStringWithoutArgs) {
|
||||
|
||||
const char *teststr = "this is 100%s correct!";
|
||||
auto hint = hintfmt(teststr);
|
||||
|
||||
std::ofstream meh("meh.txt");
|
||||
meh << hint.str() << std::endl;
|
||||
|
||||
ASSERT_STREQ(hint.str().c_str(), teststr);
|
||||
|
||||
}
|
||||
|
||||
TEST(hintfmt, tooFewArguments) {
|
||||
|
||||
ASSERT_STREQ(
|
||||
hintfmt("only one arg %1% %2%", "fulfilled").str().c_str(),
|
||||
"only one arg " ANSI_YELLOW "fulfilled" ANSI_NORMAL " ");
|
||||
|
||||
}
|
||||
|
||||
TEST(hintfmt, tooManyArguments) {
|
||||
|
||||
ASSERT_STREQ(
|
||||
hintfmt("what about this %1% %2%", "%3%", "one", "two").str().c_str(),
|
||||
"what about this " ANSI_YELLOW "%3%" ANSI_NORMAL " " ANSI_YELLOW "one" ANSI_NORMAL);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue