1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-19 08:49:35 +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:
Sergei Zimmerman 2025-09-30 03:16:35 +03:00
parent 823c0d1140
commit a8670e8a7d
No known key found for this signature in database
3 changed files with 55 additions and 9 deletions

View file

@ -19,14 +19,13 @@ public:
}
protected:
LibStoreTest(ref<Store> store)
: store(std::move(store))
{
}
LibStoreTest()
: store(openStore({
.variant =
StoreReference::Specified{
.scheme = "dummy",
},
.params = {},
}))
: LibStoreTest(openStore("dummy://"))
{
}