diff options
author | Robert Hensing <roberth@users.noreply.github.com> | 2023-01-23 15:42:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-23 15:42:59 +0100 |
commit | 0a9acefeb5ca7c800054f328d6da24e3a333cbbd (patch) | |
tree | d99654d879afe3d39c15ce2809b564c1eeecb194 /tests/lang | |
parent | a58e9c3860e8be5030bb3d5e0a78c0e44e997b17 (diff) | |
parent | 0afdf4084cc866610d0a0b6f46221680c8420cbf (diff) |
Merge pull request #7657 from obsidiansystems/fix-7655
Fix #7655
Diffstat (limited to 'tests/lang')
-rw-r--r-- | tests/lang/eval-okay-context-introspection.exp | 2 | ||||
-rw-r--r-- | tests/lang/eval-okay-context-introspection.nix | 23 |
2 files changed, 21 insertions, 4 deletions
diff --git a/tests/lang/eval-okay-context-introspection.exp b/tests/lang/eval-okay-context-introspection.exp index 27ba77dda..03b400cc8 100644 --- a/tests/lang/eval-okay-context-introspection.exp +++ b/tests/lang/eval-okay-context-introspection.exp @@ -1 +1 @@ -true +[ true true true true true true ] diff --git a/tests/lang/eval-okay-context-introspection.nix b/tests/lang/eval-okay-context-introspection.nix index 43178bd2e..50a78d946 100644 --- a/tests/lang/eval-okay-context-introspection.nix +++ b/tests/lang/eval-okay-context-introspection.nix @@ -18,7 +18,24 @@ let }; }; - legit-context = builtins.getContext "${path}${drv.outPath}${drv.foo.outPath}${drv.drvPath}"; + combo-path = "${path}${drv.outPath}${drv.foo.outPath}${drv.drvPath}"; + legit-context = builtins.getContext combo-path; - constructed-context = builtins.getContext (builtins.appendContext "" desired-context); -in legit-context == constructed-context + reconstructed-path = builtins.appendContext + (builtins.unsafeDiscardStringContext combo-path) + desired-context; + + # Eta rule for strings with context. + etaRule = str: + str == builtins.appendContext + (builtins.unsafeDiscardStringContext str) + (builtins.getContext str); + +in [ + (legit-context == desired-context) + (reconstructed-path == combo-path) + (etaRule "foo") + (etaRule drv.drvPath) + (etaRule drv.foo.outPath) + (etaRule (builtins.unsafeDiscardOutputDependency drv.drvPath)) +] |