mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 07:22:43 +01:00
libstore: Make all StoreConfig::getReference implementations return store parameters
These stragglers have been accidentally left out when implementing the StoreConfig::getReference. Also HttpBinaryCacheStore::getReference now returns the actual store parameters, not the cacheUri parameters.
This commit is contained in:
parent
3bf1268ac6
commit
426a72c9cf
6 changed files with 44 additions and 2 deletions
|
|
@ -18,4 +18,20 @@ TEST(HttpBinaryCacheStore, constructConfigNoTrailingSlash)
|
|||
EXPECT_EQ(config.cacheUri.to_string(), "https://foo.bar.baz/a/b");
|
||||
}
|
||||
|
||||
TEST(HttpBinaryCacheStore, constructConfigWithParams)
|
||||
{
|
||||
StoreConfig::Params params{{"compression", "xz"}};
|
||||
HttpBinaryCacheStoreConfig config{"https", "foo.bar.baz/a/b/", params};
|
||||
EXPECT_EQ(config.cacheUri.to_string(), "https://foo.bar.baz/a/b");
|
||||
EXPECT_EQ(config.getReference().params, params);
|
||||
}
|
||||
|
||||
TEST(HttpBinaryCacheStore, constructConfigWithParamsAndUrlWithParams)
|
||||
{
|
||||
StoreConfig::Params params{{"compression", "xz"}};
|
||||
HttpBinaryCacheStoreConfig config{"https", "foo.bar.baz/a/b?some-param=some-value", params};
|
||||
EXPECT_EQ(config.cacheUri.to_string(), "https://foo.bar.baz/a/b?some-param=some-value");
|
||||
EXPECT_EQ(config.getReference().params, params);
|
||||
}
|
||||
|
||||
} // namespace nix
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue