diff options
| author | Phil Nash | 2017-02-01 14:13:10 +0000 |
|---|---|---|
| committer | Phil Nash | 2017-02-01 14:13:20 +0000 |
| commit | b524fa7cd8d0350c5dd647795d0772f6e12def97 (patch) | |
| tree | 1aecf346dbe8e77c91b742a4043720bc11b8b629 /include | |
| parent | 5121b5b05886c3667fa8ba738b2f55d138d35490 (diff) | |
| download | catch3-b524fa7cd8d0350c5dd647795d0772f6e12def97.tar.gz | |
Fixed bugs in escape char handling in test names
1. If escape char is first char, sets start of range
2. Multiple escape chars are handled (offsets chars to remove)
Diffstat (limited to 'include')
| -rw-r--r-- | include/internal/catch_test_spec_parser.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/internal/catch_test_spec_parser.hpp b/include/internal/catch_test_spec_parser.hpp index efe3a63c..0c328365 100644 --- a/include/internal/catch_test_spec_parser.hpp +++ b/include/internal/catch_test_spec_parser.hpp @@ -87,6 +87,8 @@ namespace Catch { m_start = start; } void escape() { + if( m_mode == None ) + m_start = m_pos; m_mode = EscapedName; m_escapeChars.push_back( m_pos ); } @@ -95,7 +97,7 @@ namespace Catch { void addPattern() { std::string token = subString(); for( size_t i = 0; i < m_escapeChars.size(); ++i ) - token = token.substr( 0, m_escapeChars[i] ) + token.substr( m_escapeChars[i]+1 ); + token = token.substr( 0, m_escapeChars[i]-i ) + token.substr( m_escapeChars[i]+1-i ); m_escapeChars.clear(); if( startsWith( token, "exclude:" ) ) { m_exclusion = true; |