"googlemock/vscode:/vscode.git/clone" did not exist on "cbca6bc3957b28b8062f20b65f9349d94a4bf0b3"
Unverified Commit b95a702d authored by Gennadiy Civil's avatar Gennadiy Civil Committed by GitHub
Browse files

Merge pull request #1707 from gennadiycivil/master

 upsream additional printer test
parents 8506852a 094d7d29
......@@ -1731,6 +1731,21 @@ TEST(PrintOptionalTest, Basic) {
EXPECT_EQ("(1.1)", PrintToString(absl::optional<double>{1.1}));
EXPECT_EQ("(\"A\")", PrintToString(absl::optional<std::string>{"A"}));
}
struct NonPrintable {
unsigned char contents = 17;
};
TEST(PrintOneofTest, Basic) {
using Type = absl::variant<int, StreamableInGlobal, NonPrintable>;
EXPECT_EQ("('int' with value 7)", PrintToString(Type(7)));
EXPECT_EQ("('StreamableInGlobal' with value StreamableInGlobal)",
PrintToString(Type(StreamableInGlobal{})));
EXPECT_EQ(
"('testing::gtest_printers_test::NonPrintable' with value 1-byte object "
"<11>)",
PrintToString(Type(NonPrintable{})));
}
#endif // GTEST_HAS_ABSL
} // namespace gtest_printers_test
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment