diff options
author | Rutger Broekhoff | 2025-07-07 21:52:08 +0200 |
---|---|---|
committer | Rutger Broekhoff | 2025-07-07 21:52:08 +0200 |
commit | ba61dfd69504ec6263a9dee9931d93adeb6f3142 (patch) | |
tree | d6c9b78e50eeab24e0c1c09ab45909a6ae3fd5db /test/testdata/eval-okay-strings-as-attrs-names.nix | |
download | verified-dyn-lang-interp-ba61dfd69504ec6263a9dee9931d93adeb6f3142.tar.gz verified-dyn-lang-interp-ba61dfd69504ec6263a9dee9931d93adeb6f3142.zip |
Initialize repository
Diffstat (limited to 'test/testdata/eval-okay-strings-as-attrs-names.nix')
-rw-r--r-- | test/testdata/eval-okay-strings-as-attrs-names.nix | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/testdata/eval-okay-strings-as-attrs-names.nix b/test/testdata/eval-okay-strings-as-attrs-names.nix new file mode 100644 index 0000000..5e40928 --- /dev/null +++ b/test/testdata/eval-okay-strings-as-attrs-names.nix | |||
@@ -0,0 +1,20 @@ | |||
1 | let | ||
2 | |||
3 | attr = { | ||
4 | "key 1" = "test"; | ||
5 | "key 2" = "caseok"; | ||
6 | }; | ||
7 | |||
8 | t1 = builtins.getAttr "key 1" attr; | ||
9 | t2 = attr."key 2"; | ||
10 | t3 = attr ? "key 1"; | ||
11 | t4 = builtins.attrNames { inherit (attr) "key 1"; }; | ||
12 | |||
13 | # This is permitted, but there is currently no way to reference this | ||
14 | # variable. | ||
15 | "foo bar" = 1; | ||
16 | |||
17 | in t1 == "test" | ||
18 | && t2 == "caseok" | ||
19 | && t3 == true | ||
20 | && t4 == ["key 1"] | ||