diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-12-13 00:48:04 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2022-12-13 00:50:43 +0100 |
commit | b3fdab28a216683365f7f04bfa9bbc5cd122d753 (patch) | |
tree | 54bd67dc94f2596be2d77a13b0b84a0afde8b067 /src/libexpr/tests/primops.cc | |
parent | edb54c62e6c66f3d26642c024d92bd20b30abf85 (diff) |
Introduce AbstractPos
This makes the position object used in exceptions abstract, with a
method getSource() to get the source code of the file in which the
error originated. This is needed for lazy trees because source files
don't necessarily exist in the filesystem, and we don't want to make
libutil depend on the InputAccessor type in libfetcher.
Diffstat (limited to 'src/libexpr/tests/primops.cc')
-rw-r--r-- | src/libexpr/tests/primops.cc | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/libexpr/tests/primops.cc b/src/libexpr/tests/primops.cc index 16cf66d2c..49fbc5e98 100644 --- a/src/libexpr/tests/primops.cc +++ b/src/libexpr/tests/primops.cc @@ -151,20 +151,7 @@ namespace nix { // The `y` attribute is at position const char* expr = "builtins.unsafeGetAttrPos \"y\" { y = \"x\"; }"; auto v = eval(expr); - ASSERT_THAT(v, IsAttrsOfSize(3)); - - auto file = v.attrs->find(createSymbol("file")); - ASSERT_NE(file, nullptr); - // FIXME: The file when running these tests is the input string?!? - ASSERT_THAT(*file->value, IsStringEq(expr)); - - auto line = v.attrs->find(createSymbol("line")); - ASSERT_NE(line, nullptr); - ASSERT_THAT(*line->value, IsIntEq(1)); - - auto column = v.attrs->find(createSymbol("column")); - ASSERT_NE(column, nullptr); - ASSERT_THAT(*column->value, IsIntEq(33)); + ASSERT_THAT(v, IsNull()); } TEST_F(PrimOpTest, hasAttr) { |