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

Function TEST

valdi/test/runtime/StringCache_tests.cpp:21–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21TEST(StringCache, canMakeStrings) {
22 auto& cache = StringCache::getGlobal();
23
24 {
25 auto str = cache.makeStringFromLiteral("hello is a test string");
26
27 ASSERT_EQ(static_cast<size_t>(22), str.length());
28 ASSERT_EQ("hello is a test string", str.toStringView());
29
30 ASSERT_TRUE(containsStringInCache(cache, "hello is a test string"));
31 }
32
33 ASSERT_FALSE(containsStringInCache(cache, "hello is a test string"));
34}
35
36TEST(StringCache, canInternStrings) {
37 auto& cache = StringCache::getGlobal();

Callers

nothing calls this directly

Calls 12

getGlobalFunction · 0.85
containsStringInCacheFunction · 0.85
makeStringFromLiteralMethod · 0.80
getInternedStringMethod · 0.80
createFunction · 0.50
StringBoxClass · 0.50
lengthMethod · 0.45
toStringViewMethod · 0.45
lockMethod · 0.45
asyncMethod · 0.45
unlockMethod · 0.45
syncMethod · 0.45

Tested by

no test coverage detected