Skip to content

Commit

Permalink
fix unit test checking registration collision
Browse files Browse the repository at this point in the history
  • Loading branch information
bkietz committed Apr 30, 2024
1 parent 6b5e52b commit e798267
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cpp/src/arrow/filesystem/localfs_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,16 @@ TEST(FileSystemFromUri, RuntimeRegisteredFactory) {
EXPECT_THAT(FileSystemFromUri("slowfile2:///hey/yo", &path),
Raises(StatusCode::Invalid));

EXPECT_THAT(RegisterFileSystemFactory("slowfile2", {SlowFileSystemFactory, "", 0}),
Ok());
EXPECT_THAT(
RegisterFileSystemFactory("slowfile2", {SlowFileSystemFactory, __FILE__, __LINE__}),
Ok());

ASSERT_OK_AND_ASSIGN(auto fs, FileSystemFromUri("slowfile2:///hey/yo", &path));
EXPECT_EQ(path, "/hey/yo");
EXPECT_EQ(fs->type_name(), "slow");

EXPECT_THAT(
RegisterFileSystemFactory("slowfile2", {SlowFileSystemFactory, "", 0}),
RegisterFileSystemFactory("slowfile2", {SlowFileSystemFactory, __FILE__, __LINE__}),
Raises(StatusCode::KeyError,
testing::HasSubstr("Attempted to register factory for scheme 'slowfile2' "
"but that scheme is already registered")));
Expand Down

0 comments on commit e798267

Please sign in to comment.