MCPcopy Create free account
hub / github.com/Snapchat/Valdi / containsStringInCache

Function containsStringInCache

valdi/test/runtime/StringCache_tests.cpp:11–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9namespace ValdiTest {
10
11static bool containsStringInCache(const StringCache& cache, std::string_view str) {
12 for (const auto& strInCache : cache.all()) {
13 if (strInCache.toStringView() == str) {
14 return true;
15 }
16 }
17
18 return false;
19}
20
21TEST(StringCache, canMakeStrings) {
22 auto& cache = StringCache::getGlobal();

Callers 1

TESTFunction · 0.85

Calls 2

allMethod · 0.65
toStringViewMethod · 0.45

Tested by

no test coverage detected