about summary refs log tree commit diff
path: root/third_party/nix/src/tests/lang/eval-okay-dynamic-attrs-bare.nix
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/tests/lang/eval-okay-dynamic-attrs-bare.nix')
-rw-r--r--third_party/nix/src/tests/lang/eval-okay-dynamic-attrs-bare.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/third_party/nix/src/tests/lang/eval-okay-dynamic-attrs-bare.nix b/third_party/nix/src/tests/lang/eval-okay-dynamic-attrs-bare.nix
new file mode 100644
index 000000000000..0dbe15e6384c
--- /dev/null
+++ b/third_party/nix/src/tests/lang/eval-okay-dynamic-attrs-bare.nix
@@ -0,0 +1,17 @@
+let
+  aString = "a";
+
+  bString = "b";
+in {
+  hasAttrs = { a.b = null; } ? ${aString}.b;
+
+  selectAttrs = { a.b = true; }.a.${bString};
+
+  selectOrAttrs = { }.${aString} or true;
+
+  binds = { ${aString}."${bString}c" = true; }.a.bc;
+
+  recBinds = rec { ${bString} = a; a = true; }.b;
+
+  multiAttrs = { ${aString} = true; ${bString} = false; }.a;
+}