diff options
Diffstat (limited to 'test/testdata/eval-okay-attrnames.nix')
-rw-r--r-- | test/testdata/eval-okay-attrnames.nix | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/testdata/eval-okay-attrnames.nix b/test/testdata/eval-okay-attrnames.nix new file mode 100644 index 0000000..e5b26e9 --- /dev/null +++ b/test/testdata/eval-okay-attrnames.nix | |||
@@ -0,0 +1,11 @@ | |||
1 | with import ./lib.nix; | ||
2 | |||
3 | let | ||
4 | |||
5 | attrs = {y = "y"; x = "x"; foo = "foo";} // rec {x = "newx"; bar = x;}; | ||
6 | |||
7 | names = builtins.attrNames attrs; | ||
8 | |||
9 | values = map (name: builtins.getAttr name attrs) names; | ||
10 | |||
11 | in assert values == builtins.attrValues attrs; concat values | ||