tests.buildenv: test finalAttrs self-reference
This is the core new capability of the PR: `buildEnv` now accepts a function `(finalAttrs: { ... })` enabling self-referencing attributes.
Verify that finalAttrs.name is accessible from within the argument function.
This commit is contained in:
+16
-1
@@ -67,7 +67,22 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
tests = tests-name // tests-passthru-paths;
|
||||
tests-finalAttrs = {
|
||||
testFinalAttrsSelfReference = {
|
||||
expr =
|
||||
let
|
||||
env = buildEnv (finalAttrs: {
|
||||
name = "test-env";
|
||||
paths = [ ];
|
||||
passthru.description = "An env named ${finalAttrs.name}";
|
||||
});
|
||||
in
|
||||
env.description;
|
||||
expected = "An env named test-env";
|
||||
};
|
||||
};
|
||||
|
||||
tests = tests-name // tests-passthru-paths // tests-finalAttrs;
|
||||
in
|
||||
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
|
||||
Reference in New Issue
Block a user