aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/test/gmock-matchers_test.cc
diff options
context:
space:
mode:
authorGennadiy Civil <gennadiycivil@users.noreply.github.com>2018-04-17 19:44:13 -0400
committerGitHub <noreply@github.com>2018-04-17 19:44:13 -0400
commit4035d6ecc030defa3500f81576b4b83f316413db (patch)
tree7666311c92d4435298f3a4c49831485c3a90048a /googlemock/test/gmock-matchers_test.cc
parent1f605414cc4137f0ad0cde4d0c7366ff2dfac590 (diff)
parent80d6e26a9c170812614f2e29c53f0893446d8cee (diff)
downloadgoogletest-4035d6ecc030defa3500f81576b4b83f316413db.tar.gz
googletest-4035d6ecc030defa3500f81576b4b83f316413db.tar.bz2
googletest-4035d6ecc030defa3500f81576b4b83f316413db.zip
Merge pull request #1577 from gennadiycivil/master
merging gmock generated matchers
Diffstat (limited to 'googlemock/test/gmock-matchers_test.cc')
-rw-r--r--googlemock/test/gmock-matchers_test.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc
index 16116b5c..c40944bb 100644
--- a/googlemock/test/gmock-matchers_test.cc
+++ b/googlemock/test/gmock-matchers_test.cc
@@ -2742,6 +2742,24 @@ TEST(AnyOfTest, VariadicMatchesWhenAnyMatches) {
41, 42, 43, 44, 45, 46, 47, 48, 49, 50));
}
+// Tests the variadic version of the ElementsAreMatcher
+TEST(ElementsAreTest, HugeMatcher) {
+ vector<int> test_vector{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
+
+ EXPECT_THAT(test_vector,
+ ElementsAre(Eq(1), Eq(2), Lt(13), Eq(4), Eq(5), Eq(6), Eq(7),
+ Eq(8), Eq(9), Eq(10), Gt(1), Eq(12)));
+}
+
+// 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};
+
+ EXPECT_THAT(test_vector, UnorderedElementsAre(
+ Eq(2), Eq(1), Gt(7), Eq(5), Eq(4), Eq(6), Eq(7),
+ Eq(3), Eq(9), Eq(12), Eq(11), Ne(122)));
+}
+
#endif // GTEST_LANG_CXX11
// Tests that AnyOf(m1, ..., mn) describes itself properly.