mirror of
https://github.com/google/googletest.git
synced 2024-12-27 10:11:03 +08:00
193353312
This commit is contained in:
parent
80d6e26a9c
commit
4707c0ffd4
@ -5212,17 +5212,20 @@ internal::AnyOfMatcher<Args...> AnyOf(const Args&... matchers) {
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
internal::ElementsAreMatcher<tuple<typename std::decay<Args>::type...>>
|
||||
internal::ElementsAreMatcher<tuple<typename std::decay<const Args&>::type...>>
|
||||
ElementsAre(const Args&... matchers) {
|
||||
return internal::ElementsAreMatcher<
|
||||
tuple<typename std::decay<Args>::type...>>(make_tuple(matchers...));
|
||||
tuple<typename std::decay<const Args&>::type...>>(
|
||||
make_tuple(matchers...));
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
internal::UnorderedElementsAreMatcher<tuple<typename std::decay<Args>::type...>>
|
||||
internal::UnorderedElementsAreMatcher<
|
||||
tuple<typename std::decay<const Args&>::type...>>
|
||||
UnorderedElementsAre(const Args&... matchers) {
|
||||
return internal::UnorderedElementsAreMatcher<
|
||||
tuple<typename std::decay<Args>::type...>>(make_tuple(matchers...));
|
||||
tuple<typename std::decay<const Args&>::type...>>(
|
||||
make_tuple(matchers...));
|
||||
}
|
||||
|
||||
#endif // GTEST_LANG_CXX11
|
||||
|
@ -2751,6 +2751,15 @@ TEST(ElementsAreTest, HugeMatcher) {
|
||||
Eq(8), Eq(9), Eq(10), Gt(1), Eq(12)));
|
||||
}
|
||||
|
||||
// Tests the variadic version of the UnorderedElementsAreMatcher
|
||||
TEST(ElementsAreTest, HugeMatcherStr) {
|
||||
vector<string> test_vector{
|
||||
"literal_string", "", "", "", "", "", "", "", "", "", "", ""};
|
||||
|
||||
EXPECT_THAT(test_vector, UnorderedElementsAre("literal_string", _, _, _, _, _,
|
||||
_, _, _, _, _, _));
|
||||
}
|
||||
|
||||
// Tests the variadic version of the UnorderedElementsAreMatcher
|
||||
TEST(ElementsAreTest, HugeMatcherUnordered) {
|
||||
vector<int> test_vector{2, 1, 8, 5, 4, 6, 7, 3, 9, 12, 11, 10};
|
||||
|
Loading…
x
Reference in New Issue
Block a user