mirror of
https://github.com/NixOS/nix
synced 2025-06-24 18:01:16 +02:00
Merge 4cd68d11b5
into 983d3922ff
This commit is contained in:
commit
ce7abffbf1
2 changed files with 16 additions and 0 deletions
|
@ -187,6 +187,10 @@ void MemorySink::createSymlink(const CanonPath & path, const std::string & targe
|
||||||
ref<SourceAccessor> makeEmptySourceAccessor()
|
ref<SourceAccessor> makeEmptySourceAccessor()
|
||||||
{
|
{
|
||||||
static auto empty = make_ref<MemorySourceAccessor>().cast<SourceAccessor>();
|
static auto empty = make_ref<MemorySourceAccessor>().cast<SourceAccessor>();
|
||||||
|
/* Don't forget to clear the display prefix, as the default constructed
|
||||||
|
SourceAccessor has the «unknown» prefix. Since this accessor is supposed
|
||||||
|
to mimic an empty root directory the prefix needs to be empty. */
|
||||||
|
empty->setPathDisplay("");
|
||||||
return empty;
|
return empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,3 +34,15 @@ rm -rf $TEST_ROOT/eval-out
|
||||||
(! nix eval --store dummy:// --write-to $TEST_ROOT/eval-out --expr '{ "." = "bla"; }')
|
(! nix eval --store dummy:// --write-to $TEST_ROOT/eval-out --expr '{ "." = "bla"; }')
|
||||||
|
|
||||||
(! nix eval --expr '~/foo')
|
(! nix eval --expr '~/foo')
|
||||||
|
|
||||||
|
expectStderr 0 nix eval --expr "/some/absolute/path" \
|
||||||
|
| grepQuiet "/some/absolute/path"
|
||||||
|
|
||||||
|
expectStderr 0 nix eval --expr "/some/absolute/path" --impure \
|
||||||
|
| grepQuiet "/some/absolute/path"
|
||||||
|
|
||||||
|
expectStderr 0 nix eval --expr "some/relative/path" \
|
||||||
|
| grepQuiet "$PWD/some/relative/path"
|
||||||
|
|
||||||
|
expectStderr 0 nix eval --expr "some/relative/path" --impure \
|
||||||
|
| grepQuiet "$PWD/some/relative/path"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue