MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Match

Function Match

tensorflow/core/platform/file_system_test.cc:152–169  ·  view source on GitHub ↗

Returns all the matched entries as a comma separated string removing the common prefix of BaseDir().

Source from the content-addressed store, hash-verified

150// Returns all the matched entries as a comma separated string removing the
151// common prefix of BaseDir().
152string Match(InterPlanetaryFileSystem* ipfs, const string& suffix_pattern) {
153 std::vector<string> results;
154 Status s =
155 ipfs->GetMatchingPaths(io::JoinPath(kPrefix, suffix_pattern), &results);
156 if (!s.ok()) {
157 return s.ToString();
158 } else {
159 std::vector<StringPiece> trimmed_results;
160 std::sort(results.begin(), results.end());
161 for (const string& result : results) {
162 StringPiece trimmed_result(result);
163 EXPECT_TRUE(
164 absl::ConsumePrefix(&trimmed_result, strings::StrCat(kPrefix, "/")));
165 trimmed_results.push_back(trimmed_result);
166 }
167 return absl::StrJoin(trimmed_results, ",");
168 }
169}
170
171TEST(InterPlanetaryFileSystemTest, IPFSMatch) {
172 InterPlanetaryFileSystem ipfs;

Callers 2

TESTFunction · 0.70
TEST_FFunction · 0.50

Calls 10

sortFunction · 0.85
ConsumePrefixFunction · 0.70
JoinPathFunction · 0.50
StrCatFunction · 0.50
GetMatchingPathsMethod · 0.45
okMethod · 0.45
ToStringMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected