diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-02-12T16·57+0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-12T16·57+0100 |
commit | 7a7ec2229834aa294b3e09df7f514b7134287ec2 (patch) | |
tree | 4c704e904b9ed21536ceb39632e61d7c78b2917b /tests/lang/eval-okay-context-introspection.nix | |
parent | 01d07b1e92c298f729a73705907b2987da9a4d0c (diff) | |
parent | b30be6b450f872f8be6dc8afa28f4b030fa8d1d1 (diff) |
Merge pull request #2628 from shlevy/context-introspection
Context introspection
Diffstat (limited to 'tests/lang/eval-okay-context-introspection.nix')
-rw-r--r-- | tests/lang/eval-okay-context-introspection.nix | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/lang/eval-okay-context-introspection.nix b/tests/lang/eval-okay-context-introspection.nix new file mode 100644 index 000000000000..43178bd2eef9 --- /dev/null +++ b/tests/lang/eval-okay-context-introspection.nix @@ -0,0 +1,24 @@ +let + drv = derivation { + name = "fail"; + builder = "/bin/false"; + system = "x86_64-linux"; + outputs = [ "out" "foo" ]; + }; + + path = "${./eval-okay-context-introspection.nix}"; + + desired-context = { + "${builtins.unsafeDiscardStringContext path}" = { + path = true; + }; + "${builtins.unsafeDiscardStringContext drv.drvPath}" = { + outputs = [ "foo" "out" ]; + allOutputs = true; + }; + }; + + legit-context = builtins.getContext "${path}${drv.outPath}${drv.foo.outPath}${drv.drvPath}"; + + constructed-context = builtins.getContext (builtins.appendContext "" desired-context); +in legit-context == constructed-context |