diff options
| author | Phil Nash | 2016-01-22 07:50:59 +0000 |
|---|---|---|
| committer | Phil Nash | 2016-01-22 07:59:06 +0000 |
| commit | b84e08ad6f11bd5981c540b7e6ed5bc7239fbae0 (patch) | |
| tree | 21bee0ab6be6020ffcc3baa21ab9e0475360f28f /include | |
| parent | aca16a0f991442ba05d3456619dd8b9159c7d522 (diff) | |
| download | catch3-b84e08ad6f11bd5981c540b7e6ed5bc7239fbae0.tar.gz | |
Fix EndsWith Matcher (and refactored EndsWith and StartsWith in terms of endsWith and startsWith) (see Issue #573)
Diffstat (limited to 'include')
| -rw-r--r-- | include/internal/catch_matchers.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/internal/catch_matchers.hpp b/include/internal/catch_matchers.hpp index cfc2451a..ab8fec15 100644 --- a/include/internal/catch_matchers.hpp +++ b/include/internal/catch_matchers.hpp @@ -234,7 +234,7 @@ namespace Matchers { virtual ~StartsWith(); virtual bool match( std::string const& expr ) const { - return m_data.adjustString( expr ).find( m_data.m_str ) == 0; + return startsWith( m_data.adjustString( expr ), m_data.m_str ); } virtual std::string toString() const { return "starts with: \"" + m_data.m_str + "\"" + m_data.toStringSuffix(); @@ -251,7 +251,7 @@ namespace Matchers { virtual ~EndsWith(); virtual bool match( std::string const& expr ) const { - return m_data.adjustString( expr ).find( m_data.m_str ) == expr.size() - m_data.m_str.size(); + return endsWith( m_data.adjustString( expr ), m_data.m_str ); } virtual std::string toString() const { return "ends with: \"" + m_data.m_str + "\"" + m_data.toStringSuffix(); |