abort with a descriptive message on bad HintFmt usage

Change-Id: Ic2f05572042343a8160fd971394372f5f2706fc4
This commit is contained in:
Qyriad
2024-04-15 23:09:16 +00:00
parent 80bbfe2034
commit 4e68deef80
2 changed files with 26 additions and 15 deletions
+2 -2
View File
@@ -15,9 +15,9 @@ TEST(HintFmt, arg_count)
ASSERT_EQ(HintFmt("%1%", "hello").str(), ANSI_MAGENTA "hello" ANSI_NORMAL);
// Argument counts are detected at construction.
ASSERT_THROW(HintFmt("%s %s", 1), boost::io::too_few_args);
ASSERT_DEATH(HintFmt("%s %s", 1), "HintFmt received incorrect");
ASSERT_THROW(HintFmt("%s", 1, 2), boost::io::too_many_args);
ASSERT_DEATH(HintFmt("%s", 1, 2), "HintFmt received incorrect");
}
}