Googletest export
Fix std::move to std::forward where appropriate to support reference types. PiperOrigin-RevId: 292923058
This commit is contained in:
@@ -764,9 +764,16 @@ MATCHER_P2(ReferencesAnyOf, variable1, variable2, "") {
|
||||
|
||||
TEST(MatcherPnMacroTest, WorksWhenExplicitlyInstantiatedWithReferences) {
|
||||
UncopyableFoo foo1('1'), foo2('2'), foo3('3');
|
||||
const Matcher<const UncopyableFoo&> m =
|
||||
const Matcher<const UncopyableFoo&> const_m =
|
||||
ReferencesAnyOf<const UncopyableFoo&, const UncopyableFoo&>(foo1, foo2);
|
||||
|
||||
EXPECT_TRUE(const_m.Matches(foo1));
|
||||
EXPECT_TRUE(const_m.Matches(foo2));
|
||||
EXPECT_FALSE(const_m.Matches(foo3));
|
||||
|
||||
const Matcher<UncopyableFoo&> m =
|
||||
ReferencesAnyOf<UncopyableFoo&, UncopyableFoo&>(foo1, foo2);
|
||||
|
||||
EXPECT_TRUE(m.Matches(foo1));
|
||||
EXPECT_TRUE(m.Matches(foo2));
|
||||
EXPECT_FALSE(m.Matches(foo3));
|
||||
|
||||
Reference in New Issue
Block a user