coryan commented on a change in pull request #11943:
URL: https://github.com/apache/arrow/pull/11943#discussion_r768707118



##########
File path: cpp/src/arrow/filesystem/gcsfs_test.cc
##########
@@ -187,6 +193,31 @@ class GcsIntegrationTest : public ::testing::Test {
 
   std::string RandomFolderName() { return RandomChars(32) + "/"; }
 
+  struct Hierarchy {
+    std::string base_dir;
+    std::vector<FileInfo> contents;
+  };
+
+  Result<Hierarchy> CreateHierarchy(std::shared_ptr<arrow::fs::FileSystem> fs) 
{
+    const char* const kTestFolders[] = {
+        "a/", "a/0/", "a/0/0/", "a/1/", "a/2/",
+    };
+    auto result = Hierarchy{PreexistingBucketPath() + "a/", {}};
+    for (auto const* f : kTestFolders) {
+      const auto folder = PreexistingBucketPath() + f;
+      RETURN_NOT_OK(fs->CreateDir(folder, true));
+      result.contents.push_back(arrow::fs::Dir(folder));
+      for (int i = 0; i != 64; ++i) {
+        const auto filename = folder + "test-file-" + std::to_string(i);
+        ARROW_ASSIGN_OR_RAISE(auto w, fs->OpenOutputStream(filename, {}));
+        RETURN_NOT_OK(w->Write(filename.data(), filename.size()));
+        RETURN_NOT_OK(w->Close());

Review comment:
       Done.

##########
File path: cpp/src/arrow/filesystem/gcsfs_test.cc
##########
@@ -39,6 +39,11 @@
 
 namespace arrow {
 namespace fs {
+/// Custom comparison for FileInfo, we need this to use complex googletest 
matchers.

Review comment:
       I think the problem would remain `::testing::ElementsAreArray` also 
requires `operator==`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to