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



##########
File path: cpp/src/arrow/filesystem/gcsfs_test.cc
##########
@@ -0,0 +1,51 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow/filesystem/gcsfs.h"
+
+#include <gmock/gmock-matchers.h>
+#include <gmock/gmock-more-matchers.h>
+#include <gtest/gtest.h>
+
+#include <string>
+
+#include "arrow/testing/gtest_util.h"
+#include "arrow/testing/util.h"
+
+namespace arrow {
+namespace fs {
+namespace {
+
+using ::testing::IsEmpty;
+using ::testing::Not;
+using ::testing::NotNull;
+
+TEST(GCSFileSystem, Compare) {
+  auto a = internal::MakeGcsFileSystemForTest(GcsOptions{});
+  EXPECT_THAT(a.get(), NotNull());
+  EXPECT_EQ(a, a);
+
+  auto b = internal::MakeGcsFileSystemForTest(GcsOptions{});
+  EXPECT_THAT(b.get(), NotNull());
+  EXPECT_EQ(b, b);
+
+  EXPECT_NE(a, b);

Review comment:
       I do not know what "logically equals" means.  At a guess something like 
"modulo transient errors, both produce the same results"?  If so, I am not sure 
there is a reliable way to do that: consider `storage.googleapis.com` vs. 
`private.googleapis.com` as endpoint overrides, different strings, but 
depending on your environment, exactly the same behavior (or not!).
   
   Anyway, implemented something closer to the current implementation for the 
S3 FileSystem.

##########
File path: cpp/src/arrow/filesystem/gcsfs_test.cc
##########
@@ -0,0 +1,51 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow/filesystem/gcsfs.h"
+
+#include <gmock/gmock-matchers.h>
+#include <gmock/gmock-more-matchers.h>
+#include <gtest/gtest.h>
+
+#include <string>
+
+#include "arrow/testing/gtest_util.h"
+#include "arrow/testing/util.h"
+
+namespace arrow {
+namespace fs {
+namespace {
+
+using ::testing::IsEmpty;
+using ::testing::Not;
+using ::testing::NotNull;
+
+TEST(GCSFileSystem, Compare) {
+  auto a = internal::MakeGcsFileSystemForTest(GcsOptions{});
+  EXPECT_THAT(a.get(), NotNull());
+  EXPECT_EQ(a, a);
+
+  auto b = internal::MakeGcsFileSystemForTest(GcsOptions{});
+  EXPECT_THAT(b.get(), NotNull());

Review comment:
       Doh, fixed.

##########
File path: cpp/src/arrow/filesystem/gcsfs_test.cc
##########
@@ -0,0 +1,51 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow/filesystem/gcsfs.h"
+
+#include <gmock/gmock-matchers.h>
+#include <gmock/gmock-more-matchers.h>
+#include <gtest/gtest.h>
+
+#include <string>
+
+#include "arrow/testing/gtest_util.h"
+#include "arrow/testing/util.h"
+
+namespace arrow {
+namespace fs {
+namespace {
+
+using ::testing::IsEmpty;
+using ::testing::Not;
+using ::testing::NotNull;
+
+TEST(GCSFileSystem, Compare) {
+  auto a = internal::MakeGcsFileSystemForTest(GcsOptions{});
+  EXPECT_THAT(a.get(), NotNull());
+  EXPECT_EQ(a, a);

Review comment:
       Actually we want `a->Equals()` fixed.




-- 
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