Skip to content

Commit

Permalink
Patch:Failure to apply filters through external file
Browse files Browse the repository at this point in the history
  • Loading branch information
amitherman95 committed Oct 8, 2019
1 parent 23e30b7 commit 68486ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
14 changes: 11 additions & 3 deletions include/internal/catch_test_spec_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "catch_test_spec_parser.h"


namespace Catch {

TestSpecParser::TestSpecParser( ITagAliasRegistry const& tagAliases ) : m_tagAliases( &tagAliases ) {}
Expand All @@ -18,6 +19,7 @@ namespace Catch {
m_escapeChars.clear();
m_substring.reserve(m_arg.size());
m_patternName.reserve(m_arg.size());
m_realPatternPos = 0;
for( m_pos = 0; m_pos < m_arg.size(); ++m_pos )
visitChar( m_arg[m_pos] );
endMode();
Expand All @@ -32,6 +34,7 @@ namespace Catch {
escape();
m_substring += c;
m_patternName += c;
m_realPatternPos++;
return;
}else if((m_mode != EscapedName) && (c == ',') ) {
endMode();
Expand All @@ -49,7 +52,10 @@ namespace Catch {
break;
case EscapedName:
endMode();
break;
m_substring += c;
m_patternName += c;
m_realPatternPos++;
return;
default:
case Tag:
case QuotedName:
Expand All @@ -59,8 +65,10 @@ namespace Catch {
}

m_substring += c;
if( !isControlChar( c ) )
if( !isControlChar( c ) ) {
m_patternName += c;
m_realPatternPos++;
}
}
// Two of the processing methods return true to signal the caller to return
// without adding the given character to the current pattern strings
Expand Down Expand Up @@ -119,7 +127,7 @@ namespace Catch {
void TestSpecParser::escape() {
saveLastMode();
m_mode = EscapedName;
m_escapeChars.push_back( m_pos );
m_escapeChars.push_back(m_realPatternPos);
}
bool TestSpecParser::isControlChar( char c ) const {
switch( m_mode ) {
Expand Down
1 change: 1 addition & 0 deletions include/internal/catch_test_spec_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace Catch {
Mode lastMode = None;
bool m_exclusion = false;
std::size_t m_pos = 0;
std::size_t m_realPatternPos = 0;
std::string m_arg;
std::string m_substring;
std::string m_patternName;
Expand Down

0 comments on commit 68486ca

Please sign in to comment.