1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-15 15:02:42 +01:00

Merge pull request #13911 from xokdvium/store-uri-daemon-local

libstore: Do not normalize daemon -> unix://, local -> local://
This commit is contained in:
Eelco Dolstra 2025-09-07 14:10:45 +02:00 committed by GitHub
commit 9ff427d7ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 90 additions and 24 deletions

View file

@ -0,0 +1 @@
daemon

View file

@ -0,0 +1 @@
local

View file

@ -33,4 +33,10 @@ TEST(LocalStore, constructConfig_rootPath)
EXPECT_EQ(config.rootDir.get(), std::optional{"/foo/bar"});
}
TEST(LocalStore, constructConfig_to_string)
{
LocalStoreConfig config{"local", "", {}};
EXPECT_EQ(config.getReference().to_string(), "local");
}
} // namespace nix

View file

@ -107,6 +107,13 @@ URI_TEST_READ(local_shorthand_1, localExample_1)
URI_TEST_READ(local_shorthand_2, localExample_2)
URI_TEST(
local_shorthand_3,
(StoreReference{
.variant = StoreReference::Local{},
.params = {},
}))
static StoreReference unixExample{
.variant =
StoreReference::Specified{
@ -134,4 +141,11 @@ URI_TEST(
.params = {},
}))
URI_TEST(
daemon_shorthand,
(StoreReference{
.variant = StoreReference::Daemon{},
.params = {},
}))
} // namespace nix

View file

@ -16,4 +16,10 @@ TEST(UDSRemoteStore, constructConfigWrongScheme)
EXPECT_THROW(UDSRemoteStoreConfig("http", "/tmp/socket", {}), UsageError);
}
TEST(UDSRemoteStore, constructConfig_to_string)
{
UDSRemoteStoreConfig config{"unix", "", {}};
EXPECT_EQ(config.getReference().to_string(), "daemon");
}
} // namespace nix