mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +01:00
libexpr-tests: Add unit tests for broken readDir /. for pure eval
A very unfortunate interaction of current filtering with pure eval is
that the following actually leads to `lib.a = {}`. This just adds a unit
test for this broken behavior. This is really good to be done as a unit test
via the in-memory store.
{
outputs =
{ ... }:
{
lib.a = builtins.readDir /.;
};
}
This commit is contained in:
parent
823c0d1140
commit
a8670e8a7d
3 changed files with 55 additions and 9 deletions
|
|
@ -26,11 +26,20 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
LibExprTest()
|
||||
LibExprTest(ref<Store> store, auto && makeEvalSettings)
|
||||
: LibStoreTest()
|
||||
, evalSettings(makeEvalSettings(readOnlyMode))
|
||||
, state({}, store, fetchSettings, evalSettings, nullptr)
|
||||
{
|
||||
evalSettings.nixPath = {};
|
||||
}
|
||||
|
||||
LibExprTest()
|
||||
: LibExprTest(openStore("dummy://"), [](bool & readOnlyMode) {
|
||||
EvalSettings settings{readOnlyMode};
|
||||
settings.nixPath = {};
|
||||
return settings;
|
||||
})
|
||||
{
|
||||
}
|
||||
|
||||
Value eval(std::string input, bool forceValue = true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue