| 191 | } |
| 192 | |
| 193 | std::unordered_set<std::string> LoadIdentityPhraseKeys( |
| 194 | const std::string& phrasesPath) { |
| 195 | std::ifstream stream(phrasesPath); |
| 196 | EXPECT_TRUE(stream.is_open()) << phrasesPath; |
| 197 | |
| 198 | std::unordered_set<std::string> identityKeys; |
| 199 | std::string line; |
| 200 | while (std::getline(stream, line)) { |
| 201 | if (!IsDictionaryEntry(line)) { |
| 202 | continue; |
| 203 | } |
| 204 | |
| 205 | const size_t tab = line.find('\t'); |
| 206 | if (tab == std::string::npos) { |
| 207 | ADD_FAILURE() << line; |
| 208 | continue; |
| 209 | } |
| 210 | const std::string key = line.substr(0, tab); |
| 211 | const std::string values = line.substr(tab + 1); |
| 212 | for (const std::string& value : SplitValues(values)) { |
| 213 | if (key == value) { |
| 214 | identityKeys.insert(key); |
| 215 | break; |
| 216 | } |
| 217 | } |
| 218 | } |
| 219 | return identityKeys; |
| 220 | } |
| 221 | |
| 222 | void ExpectRevPhrasesComplete(const std::string& variantsName) { |
| 223 | std::unique_ptr<Runfiles> runfiles(Runfiles::CreateForTest()); |
no test coverage detected