MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / addPattern

Method addPattern

unittests/catch.hpp:3212–3229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3210
3211 template<typename T>
3212 void addPattern() {
3213 std::string token = subString();
3214 for( std::size_t i = 0; i < m_escapeChars.size(); ++i )
3215 token = token.substr( 0, m_escapeChars[i]-m_start-i ) + token.substr( m_escapeChars[i]-m_start-i+1 );
3216 m_escapeChars.clear();
3217 if( startsWith( token, "exclude:" ) ) {
3218 m_exclusion = true;
3219 token = token.substr( 8 );
3220 }
3221 if( !token.empty() ) {
3222 TestSpec::PatternPtr pattern = std::make_shared<T>( token );
3223 if( m_exclusion )
3224 pattern = std::make_shared<TestSpec::ExcludedPattern>( pattern );
3225 m_currentFilter.m_patterns.push_back( pattern );
3226 }
3227 m_exclusion = false;
3228 m_mode = None;
3229 }
3230
3231 void addFilter();
3232 };

Callers

nothing calls this directly

Calls 4

startsWithFunction · 0.85
substrMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected