From 8a8be2267de5c609e9083717bdd957d2f7ed4456 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 23 Jun 2014 07:17:58 -0700 Subject: [PATCH] More tests. --- test/printf-test.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/printf-test.cc b/test/printf-test.cc index a7a82528..f48b0e16 100644 --- a/test/printf-test.cc +++ b/test/printf-test.cc @@ -265,6 +265,10 @@ TEST(PrintfTest, IgnorePrecisionForNonNumericArg) { TEST(PrintfTest, DynamicPrecision) { EXPECT_EQ("00042", str(fmt::sprintf("%.*d", 5, 42))); + EXPECT_THROW_MSG(fmt::sprintf("%.*d", 5.0, 42), FormatError, + "precision is not integer"); + EXPECT_THROW_MSG(fmt::sprintf("%.*d"), FormatError, + "argument index is out of range in format"); // TODO: more tests }