|
30 | 30 | #include "arrow/filesystem/path_util.h" |
31 | 31 | #include "arrow/filesystem/test_util.h" |
32 | 32 | #include "arrow/filesystem/util_internal.h" |
| 33 | +#include "arrow/testing/examplefs.h" |
33 | 34 | #include "arrow/testing/gtest_util.h" |
34 | 35 | #include "arrow/testing/matchers.h" |
35 | 36 | #include "arrow/util/io_util.h" |
@@ -84,6 +85,12 @@ Result<std::shared_ptr<FileSystem>> FSFromUriOrPath(const std::string& uri, |
84 | 85 | //////////////////////////////////////////////////////////////////////////// |
85 | 86 | // Registered FileSystemFactory tests |
86 | 87 |
|
| 88 | +struct ConcreteTypedOption : ExampleTypedOption { |
| 89 | + explicit ConcreteTypedOption(int value) : value_(value) {} |
| 90 | + int value() const override { return value_; } |
| 91 | + int value_; |
| 92 | +}; |
| 93 | + |
87 | 94 | class SlowFileSystemPublicProps : public SlowFileSystem { |
88 | 95 | public: |
89 | 96 | SlowFileSystemPublicProps(std::shared_ptr<FileSystem> base_fs, double average_latency, |
@@ -153,9 +160,11 @@ TEST(FileSystemFromUri, LoadedRegisteredFactory) { |
153 | 160 | std::vector<std::pair<std::string, std::any>> options{ |
154 | 161 | {"example_option_string", std::string("example_value")}, |
155 | 162 | {"example_option_int", 42}, |
| 163 | + {"example_typed_option", |
| 164 | + std::shared_ptr<ExampleTypedOption>(std::make_shared<ConcreteTypedOption>(12345))}, |
156 | 165 | }; |
157 | 166 | ASSERT_OK_AND_ASSIGN(fs, FileSystemFromUri("example:///hey/yo", options, &path)); |
158 | | - EXPECT_EQ(path, "/hey/yo/example_value/42"); |
| 167 | + EXPECT_EQ(path, "/hey/yo/example_value/42/12345"); |
159 | 168 | EXPECT_EQ(fs->type_name(), "local"); |
160 | 169 | } |
161 | 170 |
|
|
0 commit comments