Improve String matcher handling of case sensitivity
The old implementation of String matchers worked by making a, potentially lower-cased, copy of both the constructor arg, and the arg to `match` calls. The new implementation does not make copies, and instead does per-character lowering if needed. This is a win in **most** cases, with two exceptions: 1) Case-insensitive `Equals` between long strings. The old implementation is easy to autovectorize by the compiler, which wins over the extra copy with sufficiently long inputs. 2) Case-insensitive `ContainsSubstring` with inputs that trigger the worst case complexity of O(m*n) of the naive implementation. The latter is fixable with some elbow grease by implementing a proper string search algorithm, but the former is a cost we have to live with.
This commit is contained in:
10 files changed
+142
-110
No files matched your search
@@ -631,7 +631,7 @@ Condition.tests.cpp:<line number>: passed: x == Approx( 1.3 ) for: 1.30000000000
|
||||
==
|
||||
Approx( 1.30000000000000004 )
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Equals( "this string contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring"
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Equals( "this string contains 'ABC' as a substring", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Equals( "this string contains 'ABC' as a substring", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Equals( "this string contains 'ABC' as a substring" ) for: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring"
|
||||
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" equals: "something else" (case insensitive)
|
||||
ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(WhatException{}) == "This exception has overridden what() method" for: "This exception has overridden what() method"
|
||||
@@ -654,11 +654,11 @@ Matchers.tests.cpp:<line number>: passed: throwsDerivedException(), DerivedExcep
|
||||
Matchers.tests.cpp:<line number>: passed: throwsDerivedException(), DerivedException, MessageMatches( !StartsWith( "::what" ) ) for: DerivedException::what matches "not starts with: "::what""
|
||||
Matchers.tests.cpp:<line number>: passed: throwsSpecialException( 2 ), SpecialException, MessageMatches( StartsWith( "Special" ) ) for: SpecialException::what matches "starts with: "Special""
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows(), "expected exception" for: "expected exception" equals: "expected exception"
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) for: "expected exception" equals: "expected exception" (case insensitive)
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) for: "expected exception" equals: "expecteD Exception" (case insensitive)
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows(), StartsWith( "expected" ) for: "expected exception" starts with: "expected"
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows(), EndsWith( "exception" ) for: "expected exception" ends with: "exception"
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows(), ContainsSubstring( "except" ) for: "expected exception" contains: "except"
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive)
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "exCept" (case insensitive)
|
||||
ToString.tests.cpp:<line number>: passed: tos == tos for: { stringification failed with an exception: "Invalid" }
|
||||
==
|
||||
{ stringification failed with an exception: "Invalid" }
|
||||
@@ -1912,11 +1912,11 @@ ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify(arr) =
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "string" ) for: "this string contains 'abc' as a substring" contains: "string"
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "string", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "string" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "abc" ) for: "this string contains 'abc' as a substring" contains: "abc"
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "abc" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "aBC" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), StartsWith( "this" ) for: "this string contains 'abc' as a substring" starts with: "this"
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" starts with: "this" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" starts with: "THIS" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), EndsWith( "substring" ) for: "this string contains 'abc' as a substring" ends with: "substring"
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" ends with: " substring" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" ends with: " SuBsTrInG" (case insensitive)
|
||||
String.tests.cpp:<line number>: passed: empty.empty() for: true
|
||||
String.tests.cpp:<line number>: passed: empty.size() == 0 for: 0 == 0
|
||||
String.tests.cpp:<line number>: passed: std::strcmp( empty.data(), "" ) == 0 for: 0 == 0
|
||||
|
||||
@@ -629,7 +629,7 @@ Condition.tests.cpp:<line number>: passed: x == Approx( 1.3 ) for: 1.30000000000
|
||||
==
|
||||
Approx( 1.30000000000000004 )
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Equals( "this string contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring"
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Equals( "this string contains 'ABC' as a substring", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Equals( "this string contains 'ABC' as a substring", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Equals( "this string contains 'ABC' as a substring" ) for: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring"
|
||||
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" equals: "something else" (case insensitive)
|
||||
ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(WhatException{}) == "This exception has overridden what() method" for: "This exception has overridden what() method"
|
||||
@@ -652,11 +652,11 @@ Matchers.tests.cpp:<line number>: passed: throwsDerivedException(), DerivedExcep
|
||||
Matchers.tests.cpp:<line number>: passed: throwsDerivedException(), DerivedException, MessageMatches( !StartsWith( "::what" ) ) for: DerivedException::what matches "not starts with: "::what""
|
||||
Matchers.tests.cpp:<line number>: passed: throwsSpecialException( 2 ), SpecialException, MessageMatches( StartsWith( "Special" ) ) for: SpecialException::what matches "starts with: "Special""
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows(), "expected exception" for: "expected exception" equals: "expected exception"
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) for: "expected exception" equals: "expected exception" (case insensitive)
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) for: "expected exception" equals: "expecteD Exception" (case insensitive)
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows(), StartsWith( "expected" ) for: "expected exception" starts with: "expected"
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows(), EndsWith( "exception" ) for: "expected exception" ends with: "exception"
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows(), ContainsSubstring( "except" ) for: "expected exception" contains: "except"
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive)
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "exCept" (case insensitive)
|
||||
ToString.tests.cpp:<line number>: passed: tos == tos for: { stringification failed with an exception: "Invalid" }
|
||||
==
|
||||
{ stringification failed with an exception: "Invalid" }
|
||||
@@ -1905,11 +1905,11 @@ ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify(arr) =
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "string" ) for: "this string contains 'abc' as a substring" contains: "string"
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "string", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "string" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "abc" ) for: "this string contains 'abc' as a substring" contains: "abc"
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "abc" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "aBC" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), StartsWith( "this" ) for: "this string contains 'abc' as a substring" starts with: "this"
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" starts with: "this" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" starts with: "THIS" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), EndsWith( "substring" ) for: "this string contains 'abc' as a substring" ends with: "substring"
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" ends with: " substring" (case insensitive)
|
||||
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" ends with: " SuBsTrInG" (case insensitive)
|
||||
String.tests.cpp:<line number>: passed: empty.empty() for: true
|
||||
String.tests.cpp:<line number>: passed: empty.size() == 0 for: 0 == 0
|
||||
String.tests.cpp:<line number>: passed: std::strcmp( empty.data(), "" ) == 0 for: 0 == 0
|
||||
|
||||
@@ -4521,7 +4521,7 @@ Matchers.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( testStringForMatching(), Equals( "this string contains 'ABC' as a substring", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" equals: "this string contains
|
||||
'abc' as a substring" (case insensitive)
|
||||
'ABC' as a substring" (case insensitive)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Equals string matcher
|
||||
@@ -4679,7 +4679,7 @@ Exception.tests.cpp:<line number>
|
||||
Exception.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THROWS_WITH( thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"expected exception" equals: "expected exception" (case insensitive)
|
||||
"expected exception" equals: "expecteD Exception" (case insensitive)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Exception messages can be tested for
|
||||
@@ -4706,7 +4706,7 @@ with expansion:
|
||||
Exception.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THROWS_WITH( thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"expected exception" contains: "except" (case insensitive)
|
||||
"expected exception" contains: "exCept" (case insensitive)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Exception thrown inside stringify does not fail the test
|
||||
@@ -12195,7 +12195,7 @@ with expansion:
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" contains: "abc" (case
|
||||
"this string contains 'abc' as a substring" contains: "aBC" (case
|
||||
insensitive)
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
@@ -12206,7 +12206,7 @@ with expansion:
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" starts with: "this" (case
|
||||
"this string contains 'abc' as a substring" starts with: "THIS" (case
|
||||
insensitive)
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
@@ -12217,7 +12217,7 @@ with expansion:
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" ends with: " substring" (case
|
||||
"this string contains 'abc' as a substring" ends with: " SuBsTrInG" (case
|
||||
insensitive)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@@ -4519,7 +4519,7 @@ Matchers.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( testStringForMatching(), Equals( "this string contains 'ABC' as a substring", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" equals: "this string contains
|
||||
'abc' as a substring" (case insensitive)
|
||||
'ABC' as a substring" (case insensitive)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Equals string matcher
|
||||
@@ -4677,7 +4677,7 @@ Exception.tests.cpp:<line number>
|
||||
Exception.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THROWS_WITH( thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"expected exception" equals: "expected exception" (case insensitive)
|
||||
"expected exception" equals: "expecteD Exception" (case insensitive)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Exception messages can be tested for
|
||||
@@ -4704,7 +4704,7 @@ with expansion:
|
||||
Exception.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THROWS_WITH( thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"expected exception" contains: "except" (case insensitive)
|
||||
"expected exception" contains: "exCept" (case insensitive)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Exception thrown inside stringify does not fail the test
|
||||
@@ -12188,7 +12188,7 @@ with expansion:
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" contains: "abc" (case
|
||||
"this string contains 'abc' as a substring" contains: "aBC" (case
|
||||
insensitive)
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
@@ -12199,7 +12199,7 @@ with expansion:
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" starts with: "this" (case
|
||||
"this string contains 'abc' as a substring" starts with: "THIS" (case
|
||||
insensitive)
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
@@ -12210,7 +12210,7 @@ with expansion:
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
CHECK_THAT( testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" ends with: " substring" (case
|
||||
"this string contains 'abc' as a substring" ends with: " SuBsTrInG" (case
|
||||
insensitive)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@@ -1131,7 +1131,7 @@ ok {test-number} - x == Approx( 1.3 ) for: 1.30000000000000027 == Approx( 1.3000
|
||||
# Equals
|
||||
ok {test-number} - testStringForMatching(), Equals( "this string contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring"
|
||||
# Equals
|
||||
ok {test-number} - testStringForMatching(), Equals( "this string contains 'ABC' as a substring", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" (case insensitive)
|
||||
ok {test-number} - testStringForMatching(), Equals( "this string contains 'ABC' as a substring", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" (case insensitive)
|
||||
# Equals string matcher
|
||||
not ok {test-number} - testStringForMatching(), Equals( "this string contains 'ABC' as a substring" ) for: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring"
|
||||
# Equals string matcher
|
||||
@@ -1169,7 +1169,7 @@ ok {test-number} - throwsSpecialException( 2 ), SpecialException, MessageMatches
|
||||
# Exception messages can be tested for
|
||||
ok {test-number} - thisThrows(), "expected exception" for: "expected exception" equals: "expected exception"
|
||||
# Exception messages can be tested for
|
||||
ok {test-number} - thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) for: "expected exception" equals: "expected exception" (case insensitive)
|
||||
ok {test-number} - thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) for: "expected exception" equals: "expecteD Exception" (case insensitive)
|
||||
# Exception messages can be tested for
|
||||
ok {test-number} - thisThrows(), StartsWith( "expected" ) for: "expected exception" starts with: "expected"
|
||||
# Exception messages can be tested for
|
||||
@@ -1177,7 +1177,7 @@ ok {test-number} - thisThrows(), EndsWith( "exception" ) for: "expected exceptio
|
||||
# Exception messages can be tested for
|
||||
ok {test-number} - thisThrows(), ContainsSubstring( "except" ) for: "expected exception" contains: "except"
|
||||
# Exception messages can be tested for
|
||||
ok {test-number} - thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive)
|
||||
ok {test-number} - thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "exCept" (case insensitive)
|
||||
# Exception thrown inside stringify does not fail the test
|
||||
ok {test-number} - tos == tos for: { stringification failed with an exception: "Invalid" } == { stringification failed with an exception: "Invalid" }
|
||||
# Exceptions matchers
|
||||
@@ -2916,15 +2916,15 @@ ok {test-number} - testStringForMatching(), ContainsSubstring( "string", Catch::
|
||||
# String matchers
|
||||
ok {test-number} - testStringForMatching(), ContainsSubstring( "abc" ) for: "this string contains 'abc' as a substring" contains: "abc"
|
||||
# String matchers
|
||||
ok {test-number} - testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "abc" (case insensitive)
|
||||
ok {test-number} - testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "aBC" (case insensitive)
|
||||
# String matchers
|
||||
ok {test-number} - testStringForMatching(), StartsWith( "this" ) for: "this string contains 'abc' as a substring" starts with: "this"
|
||||
# String matchers
|
||||
ok {test-number} - testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" starts with: "this" (case insensitive)
|
||||
ok {test-number} - testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" starts with: "THIS" (case insensitive)
|
||||
# String matchers
|
||||
ok {test-number} - testStringForMatching(), EndsWith( "substring" ) for: "this string contains 'abc' as a substring" ends with: "substring"
|
||||
# String matchers
|
||||
ok {test-number} - testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" ends with: " substring" (case insensitive)
|
||||
ok {test-number} - testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" ends with: " SuBsTrInG" (case insensitive)
|
||||
# StringRef
|
||||
ok {test-number} - empty.empty() for: true
|
||||
# StringRef
|
||||
|
||||
@@ -1129,7 +1129,7 @@ ok {test-number} - x == Approx( 1.3 ) for: 1.30000000000000027 == Approx( 1.3000
|
||||
# Equals
|
||||
ok {test-number} - testStringForMatching(), Equals( "this string contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring"
|
||||
# Equals
|
||||
ok {test-number} - testStringForMatching(), Equals( "this string contains 'ABC' as a substring", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" (case insensitive)
|
||||
ok {test-number} - testStringForMatching(), Equals( "this string contains 'ABC' as a substring", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" (case insensitive)
|
||||
# Equals string matcher
|
||||
not ok {test-number} - testStringForMatching(), Equals( "this string contains 'ABC' as a substring" ) for: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring"
|
||||
# Equals string matcher
|
||||
@@ -1167,7 +1167,7 @@ ok {test-number} - throwsSpecialException( 2 ), SpecialException, MessageMatches
|
||||
# Exception messages can be tested for
|
||||
ok {test-number} - thisThrows(), "expected exception" for: "expected exception" equals: "expected exception"
|
||||
# Exception messages can be tested for
|
||||
ok {test-number} - thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) for: "expected exception" equals: "expected exception" (case insensitive)
|
||||
ok {test-number} - thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) for: "expected exception" equals: "expecteD Exception" (case insensitive)
|
||||
# Exception messages can be tested for
|
||||
ok {test-number} - thisThrows(), StartsWith( "expected" ) for: "expected exception" starts with: "expected"
|
||||
# Exception messages can be tested for
|
||||
@@ -1175,7 +1175,7 @@ ok {test-number} - thisThrows(), EndsWith( "exception" ) for: "expected exceptio
|
||||
# Exception messages can be tested for
|
||||
ok {test-number} - thisThrows(), ContainsSubstring( "except" ) for: "expected exception" contains: "except"
|
||||
# Exception messages can be tested for
|
||||
ok {test-number} - thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive)
|
||||
ok {test-number} - thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "exCept" (case insensitive)
|
||||
# Exception thrown inside stringify does not fail the test
|
||||
ok {test-number} - tos == tos for: { stringification failed with an exception: "Invalid" } == { stringification failed with an exception: "Invalid" }
|
||||
# Exceptions matchers
|
||||
@@ -2909,15 +2909,15 @@ ok {test-number} - testStringForMatching(), ContainsSubstring( "string", Catch::
|
||||
# String matchers
|
||||
ok {test-number} - testStringForMatching(), ContainsSubstring( "abc" ) for: "this string contains 'abc' as a substring" contains: "abc"
|
||||
# String matchers
|
||||
ok {test-number} - testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "abc" (case insensitive)
|
||||
ok {test-number} - testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "aBC" (case insensitive)
|
||||
# String matchers
|
||||
ok {test-number} - testStringForMatching(), StartsWith( "this" ) for: "this string contains 'abc' as a substring" starts with: "this"
|
||||
# String matchers
|
||||
ok {test-number} - testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" starts with: "this" (case insensitive)
|
||||
ok {test-number} - testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" starts with: "THIS" (case insensitive)
|
||||
# String matchers
|
||||
ok {test-number} - testStringForMatching(), EndsWith( "substring" ) for: "this string contains 'abc' as a substring" ends with: "substring"
|
||||
# String matchers
|
||||
ok {test-number} - testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" ends with: " substring" (case insensitive)
|
||||
ok {test-number} - testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" ends with: " SuBsTrInG" (case insensitive)
|
||||
# StringRef
|
||||
ok {test-number} - empty.empty() for: true
|
||||
# StringRef
|
||||
|
||||
@@ -5102,7 +5102,7 @@ Approx( 1.30000000000000004 )
|
||||
testStringForMatching(), Equals( "this string contains 'ABC' as a substring", Catch::CaseSensitive::No )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" (case insensitive)
|
||||
"this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" (case insensitive)
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true" skips="0"/>
|
||||
@@ -5295,7 +5295,7 @@ Approx( 1.30000000000000004 )
|
||||
thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"expected exception" equals: "expected exception" (case insensitive)
|
||||
"expected exception" equals: "expecteD Exception" (case insensitive)
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/>
|
||||
@@ -5330,7 +5330,7 @@ Approx( 1.30000000000000004 )
|
||||
thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"expected exception" contains: "except" (case insensitive)
|
||||
"expected exception" contains: "exCept" (case insensitive)
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="4" failures="0" expectedFailures="0" skipped="false"/>
|
||||
@@ -14357,7 +14357,7 @@ Message from section two
|
||||
testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"this string contains 'abc' as a substring" contains: "abc" (case insensitive)
|
||||
"this string contains 'abc' as a substring" contains: "aBC" (case insensitive)
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@@ -14373,7 +14373,7 @@ Message from section two
|
||||
testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"this string contains 'abc' as a substring" starts with: "this" (case insensitive)
|
||||
"this string contains 'abc' as a substring" starts with: "THIS" (case insensitive)
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@@ -14389,7 +14389,7 @@ Message from section two
|
||||
testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"this string contains 'abc' as a substring" ends with: " substring" (case insensitive)
|
||||
"this string contains 'abc' as a substring" ends with: " SuBsTrInG" (case insensitive)
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true" skips="0"/>
|
||||
|
||||
@@ -5102,7 +5102,7 @@ Approx( 1.30000000000000004 )
|
||||
testStringForMatching(), Equals( "this string contains 'ABC' as a substring", Catch::CaseSensitive::No )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" (case insensitive)
|
||||
"this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" (case insensitive)
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true" skips="0"/>
|
||||
@@ -5295,7 +5295,7 @@ Approx( 1.30000000000000004 )
|
||||
thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"expected exception" equals: "expected exception" (case insensitive)
|
||||
"expected exception" equals: "expecteD Exception" (case insensitive)
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/>
|
||||
@@ -5330,7 +5330,7 @@ Approx( 1.30000000000000004 )
|
||||
thisThrows(), ContainsSubstring( "exCept", Catch::CaseSensitive::No )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"expected exception" contains: "except" (case insensitive)
|
||||
"expected exception" contains: "exCept" (case insensitive)
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="4" failures="0" expectedFailures="0" skipped="false"/>
|
||||
@@ -14357,7 +14357,7 @@ Message from section two
|
||||
testStringForMatching(), ContainsSubstring( "aBC", Catch::CaseSensitive::No )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"this string contains 'abc' as a substring" contains: "abc" (case insensitive)
|
||||
"this string contains 'abc' as a substring" contains: "aBC" (case insensitive)
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@@ -14373,7 +14373,7 @@ Message from section two
|
||||
testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"this string contains 'abc' as a substring" starts with: "this" (case insensitive)
|
||||
"this string contains 'abc' as a substring" starts with: "THIS" (case insensitive)
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@@ -14389,7 +14389,7 @@ Message from section two
|
||||
testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No )
|
||||
</Original>
|
||||
<Expanded>
|
||||
"this string contains 'abc' as a substring" ends with: " substring" (case insensitive)
|
||||
"this string contains 'abc' as a substring" ends with: " SuBsTrInG" (case insensitive)
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true" skips="0"/>
|
||||
|
||||
Reference in new issue
Block a user