Googletest export
Update the custom name example to not use underscores. The NOTE a few blocks above specifically calls out that test names should not contain undersccores, so probably the example should not suggest using underscores. PiperOrigin-RevId: 357204578
This commit is contained in:
parent
1a5a78b9a9
commit
bc32a87452
@ -1489,12 +1489,12 @@ INSTANTIATE_TEST_SUITE_P(
|
|||||||
MyGroup, MyTestSuite,
|
MyGroup, MyTestSuite,
|
||||||
testing::Combine(
|
testing::Combine(
|
||||||
testing::Values(MyType::VALUE_0, MyType::VALUE_1),
|
testing::Values(MyType::VALUE_0, MyType::VALUE_1),
|
||||||
testing::ValuesIn("", "")),
|
testing::Values("A", "B")),
|
||||||
[](const testing::TestParamInfo<MyTestSuite::ParamType>& info) {
|
[](const testing::TestParamInfo<MyTestSuite::ParamType>& info) {
|
||||||
std::string name = absl::StrCat(
|
std::string name = absl::StrCat(
|
||||||
std::get<0>(info.param) == MY_FOO ? "Foo" : "Bar", "_",
|
std::get<0>(info.param) == MY_FOO ? "Foo" : "Bar",
|
||||||
std::get<1>(info.param));
|
std::get<1>(info.param));
|
||||||
absl::c_replace_if(name, [](char c) { return !std::isalnum(c); }, '_');
|
absl::c_replace_if(name, [](char c) { return !std::isalnum(c); }, '');
|
||||||
return name;
|
return name;
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user