Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/projects
diff options
context:
space:
mode:
authorPhil Nash2012-10-12 07:58:17 +0100
committerPhil Nash2012-10-12 07:58:17 +0100
commit9444bbcb7bd0ba2eee6717903490ef7b8bc783a0 (patch)
tree584edcb96fb6fce3a7ae6def705d47fdbdfec9ce /projects
parent9902ac9f1afc86d83bc5107259494d7c4631adfd (diff)
downloadcatch3-9444bbcb7bd0ba2eee6717903490ef7b8bc783a0.tar.gz
Added AllOf and AnyOf matchers
Diffstat (limited to 'projects')
-rw-r--r--projects/SelfTest/MiscTests.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/projects/SelfTest/MiscTests.cpp b/projects/SelfTest/MiscTests.cpp
index d7596586..34915069 100644
--- a/projects/SelfTest/MiscTests.cpp
+++ b/projects/SelfTest/MiscTests.cpp
@@ -270,6 +270,16 @@ TEST_CASE("./failing/matchers/Equals", "")
CHECK_THAT( testStringForMatching(), Equals( "something else" ) );
}
+TEST_CASE("/succeeding/matchers/AllOf", "")
+{
+ CHECK_THAT( testStringForMatching(), AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) );
+}
+TEST_CASE("/succeeding/matchers/AnyOf", "")
+{
+ CHECK_THAT( testStringForMatching(), AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) );
+ CHECK_THAT( testStringForMatching(), AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) );
+}
+
TEST_CASE("./succeeding/matchers/Equals", "")
{
CHECK_THAT( testStringForMatching(), Equals( "this string contains 'abc' as a substring" ) );