| 19 | } |
| 20 | |
| 21 | TEST(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 | |
| 36 | TEST(StringCache, canInternStrings) { |
| 37 | auto& cache = StringCache::getGlobal(); |
nothing calls this directly
no test coverage detected