Add wrapper for getting X509_digest from a cert
[folly.git] / folly / test / FormatTest.cpp
index 535c6ceb463b0a501971e7b468aa1be488432e6c..e84bc86250c9b59b6b6e974fbf043a3d48bcef52 100644 (file)
@@ -162,6 +162,12 @@ TEST(Format, Simple) {
   EXPECT_EQ("worldXX", svformat("{hello:X<7}", defaulted(m2, "meow")));
   EXPECT_EQ("meowXXX", sformat("{[none]:X<7}", defaulted(m2, "meow")));
   EXPECT_EQ("meowXXX", svformat("{none:X<7}", defaulted(m2, "meow")));
+  try {
+    svformat("{none:X<7}", m2);
+    EXPECT_FALSE(true) << "svformat should throw on missing key";
+  } catch (const FormatKeyNotFoundException& e) {
+    EXPECT_STREQ("none", e.key());
+  }
 
   // Test indexing in strings
   EXPECT_EQ("61 62", sformat("{0[0]:x} {0[1]:x}", "abcde"));
@@ -542,7 +548,7 @@ class FormatValue<NoncopyableInt> {
   const NoncopyableInt& v_;
 };
 
-} // namespace
+} // namespace folly
 
 TEST(Format, NoncopyableArg) {
   {