out << t;
}
};
+// Otherwise, null, being (void*)0, would print as 0.
+template <>
+struct dynamic::PrintImpl<void*> {
+ static void print(dynamic const& d, std::ostream& out, void* const& nul) {
+ DCHECK_EQ((void*)0, nul);
+ out << "null";
+ }
+};
template<>
struct dynamic::PrintImpl<dynamic::ObjectImpl> {
static void print(dynamic const& d,
EXPECT_NE(ds, md["key1"]);
}
+TEST(Dynamic, PrintNull) {
+ std::stringstream ss;
+ ss << folly::dynamic(nullptr);
+ EXPECT_EQ("null", ss.str());
+}
+
int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
gflags::ParseCommandLineFlags(&argc, &argv, true);