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

summaryrefslogtreecommitdiffhomepage
path: root/include/internal/catch_commandline.cpp
diff options
context:
space:
mode:
authoramitherman952019-10-19 16:50:46 +0300
committerJozef Grajciar2019-10-19 21:14:06 +0200
commit84856844e17f78e9f3a9f113df9d3ff23aad69e1 (patch)
tree2f2a85bf82fab59fe431ea80ffc85a102a261eb9 /include/internal/catch_commandline.cpp
parent01ef7076f50f5f2b481ddf082e1afca3c926983f (diff)
downloadcatch3-84856844e17f78e9f3a9f113df9d3ff23aad69e1.tar.gz
Fixes #1766: Catch terminates when parsing invalid test name
Diffstat (limited to 'include/internal/catch_commandline.cpp')
-rw-r--r--include/internal/catch_commandline.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/internal/catch_commandline.cpp b/include/internal/catch_commandline.cpp
index 0359272c..365a3c9d 100644
--- a/include/internal/catch_commandline.cpp
+++ b/include/internal/catch_commandline.cpp
@@ -49,9 +49,15 @@ namespace Catch {
if( !line.empty() && !startsWith( line, '#' ) ) {
if( !startsWith( line, '"' ) )
line = '"' + line + '"';
- config.testsOrTags.push_back( line + ',' );
+ config.testsOrTags.push_back( line );
+ config.testsOrTags.push_back( "," );
+
}
}
+ //Remove comma in the end
+ if(!config.testsOrTags.empty())
+ config.testsOrTags.erase( config.testsOrTags.end()-1 );
+
return ParserResult::ok( ParseResultType::Matched );
};
auto const setTestOrder = [&]( std::string const& order ) {