From 285df765b91588e39d6f35a32e30b84c3cb5be75 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 18 Nov 2013 22:22:35 +0100 Subject: Add a primop unsafeGetAttrPos to return the position of an attribute --- tests/lang/eval-okay-getattrpos.exp | 1 + tests/lang/eval-okay-getattrpos.nix | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 tests/lang/eval-okay-getattrpos.exp create mode 100644 tests/lang/eval-okay-getattrpos.nix (limited to 'tests') diff --git a/tests/lang/eval-okay-getattrpos.exp b/tests/lang/eval-okay-getattrpos.exp new file mode 100644 index 000000000000..469249bbc646 --- /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 000000000000..ca6b07961547 --- /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; } -- cgit 1.4.1