mirror of
https://github.com/NixOS/nix.git
synced 2025-11-24 03:09:35 +01:00
Fix some issues with experimental config settings
Issues: 1. Features gated on disabled experimental settings should warn and be ignored, not silently succeed. 2. Experimental settings in the same config "batch" (file or env var) as the enabling of the experimental feature should work. 3. For (2), the order should not matter. These are analogous to the issues @roberth caught with my changes for arg handling, but they are instead for config handling. Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This commit is contained in:
parent
3f9589f17e
commit
2c8475600d
7 changed files with 238 additions and 66 deletions
|
|
@ -82,6 +82,7 @@ namespace nix {
|
|||
TestSetting() : AbstractSetting("test", "test", {}) {}
|
||||
void set(const std::string & value, bool append) override {}
|
||||
std::string to_string() const override { return {}; }
|
||||
bool isAppendable() override { return false; }
|
||||
};
|
||||
|
||||
Config config;
|
||||
|
|
@ -90,6 +91,7 @@ namespace nix {
|
|||
ASSERT_FALSE(config.set("test", "value"));
|
||||
config.addSetting(&setting);
|
||||
ASSERT_TRUE(config.set("test", "value"));
|
||||
ASSERT_FALSE(config.set("extra-test", "value"));
|
||||
}
|
||||
|
||||
TEST(Config, withInitialValue) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue