diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2018-07-05T14·50+0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-05T14·50+0200 |
commit | ddc9b87df15c68589ccbce59466f0e6530f5ba16 (patch) | |
tree | c75f0ffe06841ec6045c948a40c5c6cdbfcba67e /tests | |
parent | 3defdccf4b46fe678496e5e3430c55b827477d0d (diff) | |
parent | 841747b0e6d9c391c13159aaeee44599f9508868 (diff) |
Merge pull request #2273 from volth/issue-1776
[wip] lib.concatMap and lib.mapAttrs to be builtins
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lang/eval-okay-concatmap.exp | 1 | ||||
-rw-r--r-- | tests/lang/eval-okay-concatmap.nix | 5 | ||||
-rw-r--r-- | tests/lang/eval-okay-mapattrs.exp | 1 | ||||
-rw-r--r-- | tests/lang/eval-okay-mapattrs.nix | 3 |
4 files changed, 10 insertions, 0 deletions
diff --git a/tests/lang/eval-okay-concatmap.exp b/tests/lang/eval-okay-concatmap.exp new file mode 100644 index 000000000000..3b8be7739deb --- /dev/null +++ b/tests/lang/eval-okay-concatmap.exp @@ -0,0 +1 @@ +[ [ 1 3 5 7 9 ] [ "a" "z" "b" "z" ] ] diff --git a/tests/lang/eval-okay-concatmap.nix b/tests/lang/eval-okay-concatmap.nix new file mode 100644 index 000000000000..97da5d37a412 --- /dev/null +++ b/tests/lang/eval-okay-concatmap.nix @@ -0,0 +1,5 @@ +with import ./lib.nix; + +[ (builtins.concatMap (x: if x / 2 * 2 == x then [] else [ x ]) (range 0 10)) + (builtins.concatMap (x: [x] ++ ["z"]) ["a" "b"]) +] diff --git a/tests/lang/eval-okay-mapattrs.exp b/tests/lang/eval-okay-mapattrs.exp new file mode 100644 index 000000000000..3f113f17bab1 --- /dev/null +++ b/tests/lang/eval-okay-mapattrs.exp @@ -0,0 +1 @@ +{ x = "x-foo"; y = "y-bar"; } diff --git a/tests/lang/eval-okay-mapattrs.nix b/tests/lang/eval-okay-mapattrs.nix new file mode 100644 index 000000000000..f075b6275e5a --- /dev/null +++ b/tests/lang/eval-okay-mapattrs.nix @@ -0,0 +1,3 @@ +with import ./lib.nix; + +builtins.mapAttrs (name: value: name + "-" + value) { x = "foo"; y = "bar"; } |