int sum(string prefix) { int sum = 0; for (auto it = m.begin(); it != m.end(); ++it) { if (prefixMatch(prefix, it->first)) { sum += it->second; } } return sum; }
TEST(CSSTokenizerTest, MultipleCharacterTokens) { TEST_TOKENS("~=", includeMatch()); TEST_TOKENS("|=", dashMatch()); TEST_TOKENS("^=", prefixMatch()); TEST_TOKENS("$=", suffixMatch()); TEST_TOKENS("*=", substringMatch()); TEST_TOKENS("||", column()); TEST_TOKENS("|||", column(), delim('|')); TEST_TOKENS("<!--", cdo()); TEST_TOKENS("<!---", cdo(), delim('-')); TEST_TOKENS("-->", cdc()); }