summary refs log tree commit diff
path: root/tests/lang
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-11-18 22:22:35 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-11-18 22:22:35 +0100
commit285df765b91588e39d6f35a32e30b84c3cb5be75 (patch)
tree8f93b3fd527f44f14eacefb6c4c9385f670e8aea /tests/lang
parentfc33fd86b7727365caab44c05a90d5b52209131b (diff)
downloadguix-285df765b91588e39d6f35a32e30b84c3cb5be75.tar.gz
Add a primop unsafeGetAttrPos to return the position of an attribute
Diffstat (limited to 'tests/lang')
-rw-r--r--tests/lang/eval-okay-getattrpos.exp1
-rw-r--r--tests/lang/eval-okay-getattrpos.nix6
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/lang/eval-okay-getattrpos.exp b/tests/lang/eval-okay-getattrpos.exp
new file mode 100644
index 0000000000..469249bbc6
--- /dev/null
+++ b/tests/lang/eval-okay-getattrpos.exp
@@ -0,0 +1 @@
+{ column = 5; file = "eval-okay-getattrpos.nix"; line = 3; }
diff --git a/tests/lang/eval-okay-getattrpos.nix b/tests/lang/eval-okay-getattrpos.nix
new file mode 100644
index 0000000000..ca6b079615
--- /dev/null
+++ b/tests/lang/eval-okay-getattrpos.nix
@@ -0,0 +1,6 @@
+let
+  as = {
+    foo = "bar";
+  };
+  pos = builtins.unsafeGetAttrPos "foo" as;
+in { inherit (pos) column line; file = baseNameOf pos.file; }