pitrou commented on code in PR #2918:
URL: https://github.com/apache/arrow-adbc/pull/2918#discussion_r2126545275


##########
c/driver_manager/adbc_driver_manager_test.cc:
##########
@@ -335,4 +338,31 @@ TEST(AdbcDriverManagerInternal, 
AdbcDriverManagerDefaultEntrypoint) {
     EXPECT_EQ("AdbcProprietaryEngineInit", 
::AdbcDriverManagerDefaultEntrypoint(driver));
   }
 }
+
+TEST(AdbcDriverManagerInternal, AdbcParsePath) {
+  // Test parsing a path of directories
+#ifdef __WIN32
+  static const char* const delimiter = ";";
+#else
+  static const char* const delimiter = ":";
+#endif
+
+  std::vector<std::string> paths = {
+      "/usr/lib/adbc/drivers", "/usr/local/lib/adbc/drivers",
+      "/opt/adbc/drivers",     "/home/user/.config/adbc/drivers",
+      "/home/\":foo:\"/bar",
+  };
+
+  std::ostringstream joined;
+  std::copy(paths.begin(), paths.end(),
+            std::ostream_iterator<std::string>(joined, delimiter));

Review Comment:
   Apparently, `ostream_iterator` will also append a delimiter at the end (see 
example):
   https://en.cppreference.com/w/cpp/iterator/ostream_iterator.html



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