aboutsummaryrefslogtreecommitdiff
path: root/tests/lang
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-05-18 17:19:21 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-05-18 17:19:21 +0000
commit040140dd1c3c11e3aa1ca486c3f3596cbe99c008 (patch)
tree226df5b0dfc792d6409fede65b65ac2170821138 /tests/lang
parent109cde670629a0f022de1d875b55bb2f5243b271 (diff)
* Added a primop `removeAttrs' to remove attributes from a set, e.g.,
`removeAttrs attrs ["x", "y"]' returns the set `attrs' with the attributes named `x' and `y' removed. It is not an error for the named attributes to be missing from the input set.
Diffstat (limited to 'tests/lang')
-rw-r--r--tests/lang/eval-fail-remove.nix5
-rw-r--r--tests/lang/eval-okay-remove.exp1
-rw-r--r--tests/lang/eval-okay-remove.nix5
3 files changed, 11 insertions, 0 deletions
diff --git a/tests/lang/eval-fail-remove.nix b/tests/lang/eval-fail-remove.nix
new file mode 100644
index 000000000..539e0eb0a
--- /dev/null
+++ b/tests/lang/eval-fail-remove.nix
@@ -0,0 +1,5 @@
+let {
+ attrs = {x = 123; y = 456;};
+
+ body = (removeAttrs attrs ["x"]).x;
+} \ No newline at end of file
diff --git a/tests/lang/eval-okay-remove.exp b/tests/lang/eval-okay-remove.exp
new file mode 100644
index 000000000..e22e6b1b2
--- /dev/null
+++ b/tests/lang/eval-okay-remove.exp
@@ -0,0 +1 @@
+Int(456)
diff --git a/tests/lang/eval-okay-remove.nix b/tests/lang/eval-okay-remove.nix
new file mode 100644
index 000000000..4ad5ba897
--- /dev/null
+++ b/tests/lang/eval-okay-remove.nix
@@ -0,0 +1,5 @@
+let {
+ attrs = {x = 123; y = 456;};
+
+ body = (removeAttrs attrs ["x"]).y;
+} \ No newline at end of file