Skip to content

Commit d3aa697

Browse files
committed
add test with non-ascii filepath
1 parent 3297253 commit d3aa697

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

c/driver_manager/adbc_driver_manager_test.cc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,33 @@ TEST_F(DriverManifest, LoadDriverEnv) {
481481
UnsetConfigPath();
482482
}
483483

484+
TEST_F(DriverManifest, LoadNonAsciiPath) {
485+
ASSERT_THAT(AdbcLoadDriver("sqlite", nullptr, ADBC_VERSION_1_1_0, &driver, &error),
486+
Not(IsOkStatus(&error)));
487+
488+
#ifdef _WIN32
489+
std::filesystem::path non_ascii_dir = temp_dir / L"majestik møøse";
490+
#else
491+
std::filesystem::path non_ascii_dir = temp_dir / "majestik møøse";
492+
#endif
493+
494+
ASSERT_TRUE(std::filesystem::create_directories(non_ascii_dir));
495+
496+
std::ofstream test_manifest_file(non_ascii_dir / "sqlite.toml");
497+
ASSERT_TRUE(test_manifest_file.is_open());
498+
test_manifest_file << simple_manifest;
499+
test_manifest_file.close();
500+
501+
SetConfigPath(non_ascii_dir.string().c_str());
502+
503+
ASSERT_THAT(AdbcLoadDriver("sqlite", nullptr, ADBC_VERSION_1_1_0, &driver, &error),
504+
IsOkStatus(&error));
505+
506+
ASSERT_TRUE(std::filesystem::remove(non_ascii_dir / "sqlite.toml"));
507+
508+
UnsetConfigPath();
509+
}
510+
484511
TEST_F(DriverManifest, DisallowEnvConfig) {
485512
std::ofstream test_manifest_file(temp_dir / "sqlite.toml");
486513
ASSERT_TRUE(test_manifest_file.is_open());

0 commit comments

Comments
 (0)