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

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2013-09-25 18:40:07 +0100
committerPhil Nash2013-09-25 18:40:07 +0100
commit41b27af45be6bf2990f473495418c0a104f380e6 (patch)
treeb13f4009125052b4579ebb485014fa097a217e47 /include
parent649cd13c4d8d93b340adcaedc851b53fe50a3b7a (diff)
downloadcatch3-41b27af45be6bf2990f473495418c0a104f380e6.tar.gz
Fix for comma separated tags on the command line
- also added more test for tags
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_tags.hpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/internal/catch_tags.hpp b/include/internal/catch_tags.hpp
index 4e7bd5a3..36ecd1d6 100644
--- a/include/internal/catch_tags.hpp
+++ b/include/internal/catch_tags.hpp
@@ -121,9 +121,10 @@ namespace Catch {
}
bool matches( std::set<std::string> const& tags ) const {
- TagMap::const_iterator it = m_tags.begin();
- TagMap::const_iterator itEnd = m_tags.end();
- for(; it != itEnd; ++it ) {
+ for( TagMap::const_iterator
+ it = m_tags.begin(), itEnd = m_tags.end();
+ it != itEnd;
+ ++it ) {
bool found = tags.find( it->first ) != tags.end();
if( found == it->second.isNegated() )
return false;
@@ -138,9 +139,10 @@ namespace Catch {
class TagExpression {
public:
bool matches( std::set<std::string> const& tags ) const {
- std::vector<TagSet>::const_iterator it = m_tagSets.begin();
- std::vector<TagSet>::const_iterator itEnd = m_tagSets.end();
- for(; it != itEnd; ++it )
+ for( std::vector<TagSet>::const_iterator
+ it = m_tagSets.begin(), itEnd = m_tagSets.end();
+ it != itEnd;
+ ++it )
if( it->matches( tags ) )
return true;
return false;
@@ -173,6 +175,7 @@ namespace Catch {
break;
case ',':
m_exp.m_tagSets.push_back( m_currentTagSet );
+ m_currentTagSet = TagSet();
break;
}
}