Use matcher's description in AllOf if matcher has no explanation.
PiperOrigin-RevId: 652798234 Change-Id: I8e92248a2d9faf2a5719fe220145ea563acc14ff
This commit is contained in:
committed by
Copybara-Service
parent
417158b8bc
commit
d49a665484
@@ -2334,11 +2334,9 @@ TEST(ExplainMatchResultTest, AllOf_True_True) {
|
||||
EXPECT_EQ("which is 0 modulo 2, and which is 0 modulo 3", Explain(m, 6));
|
||||
}
|
||||
|
||||
// Tests that when AllOf() succeeds, but matchers have no explanation,
|
||||
// the matcher description is used.
|
||||
TEST(ExplainMatchResultTest, AllOf_True_True_2) {
|
||||
const Matcher<int> m = AllOf(Ge(2), Le(3));
|
||||
EXPECT_EQ("is >= 2, and is <= 3", Explain(m, 2));
|
||||
EXPECT_EQ("", Explain(m, 2));
|
||||
}
|
||||
|
||||
INSTANTIATE_GTEST_MATCHER_TEST_P(ExplainmatcherResultTest);
|
||||
|
||||
Reference in New Issue
Block a user