[clang-tidy] Restore test parameter operator<< function (NFC)

Clang erroneously flagged the function as "unused", but it is most
definitely used by gtest to pretty print the parameter value when
a test fails.

Make the pretty printing function a friend function in the parameter
class similar to other clang unit tests.
This commit is contained in:
Richard 2022-05-14 13:59:34 -06:00
parent 6e8ad98446
commit 9d99cf59a1
1 changed files with 5 additions and 0 deletions

View File

@ -48,6 +48,11 @@ namespace {
struct Param {
bool Matched;
const char *Text;
friend std::ostream &operator<<(std::ostream &Str, const Param &Value) {
return Str << "Matched: " << std::boolalpha << Value.Matched << ", Text: '"
<< Value.Text << "'";
}
};
class MatcherTest : public ::testing::TestWithParam<Param> {};