MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / addPattern

Method addPattern

Bcore/src/main/cpp/Dobby/tests/catch.hpp:3078–3095  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3076 std::string subString() const;
3077
3078 template <typename T> void addPattern() {
3079 std::string token = subString();
3080 for (std::size_t i = 0; i < m_escapeChars.size(); ++i)
3081 token = token.substr(0, m_escapeChars[i] - m_start - i) + token.substr(m_escapeChars[i] - m_start - i + 1);
3082 m_escapeChars.clear();
3083 if (startsWith(token, "exclude:")) {
3084 m_exclusion = true;
3085 token = token.substr(8);
3086 }
3087 if (!token.empty()) {
3088 TestSpec::PatternPtr pattern = std::make_shared<T>(token);
3089 if (m_exclusion)
3090 pattern = std::make_shared<TestSpec::ExcludedPattern>(pattern);
3091 m_currentFilter.m_patterns.push_back(pattern);
3092 }
3093 m_exclusion = false;
3094 m_mode = None;
3095 }
3096
3097 void addFilter();
3098};

Callers

nothing calls this directly

Calls 5

startsWithFunction · 0.85
sizeMethod · 0.45
substrMethod · 0.45
clearMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected