While the err file should always be empty, we prefer not have (easily avoidable) warnings in the log, in order for actual warnings to be spotted more easily. Additionally this way no additional changes are required in case they make use of some depreacted features in the future. Change-Id: Ie078e2a851b2035d839f6b95d4188e475eb96b2d
39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
from collections.abc import Callable
|
|
from pathlib import Path
|
|
|
|
from functional2.lang.test_lang import test_eval as nix_eval
|
|
from functional2.testlib.fixtures.file_helper import with_files, CopyTree, CopyFile, AssetSymlink
|
|
from functional2.testlib.fixtures.nix import Nix
|
|
from functional2.testlib.fixtures.snapshot import Snapshot
|
|
|
|
|
|
@with_files(
|
|
{
|
|
"dir1": CopyTree("dir1"),
|
|
"dir2": CopyTree("dir2"),
|
|
"dir3": CopyTree("dir3"),
|
|
"dir4": CopyTree("dir4"),
|
|
"lib.nix": CopyFile("../lib.nix"),
|
|
"in.nix": CopyFile("in.nix"),
|
|
"out.exp": AssetSymlink("eval-okay.out.exp"),
|
|
"err.exp": AssetSymlink("eval-okay.err.exp"),
|
|
}
|
|
)
|
|
def test_search_path(files: Path, nix: Nix, snapshot: Callable[[str], Snapshot]):
|
|
nix.env.set_env("NIX_PATH", "dir3:dir4")
|
|
nix_eval(
|
|
files,
|
|
nix,
|
|
[
|
|
"--extra-deprecated-features",
|
|
"shadow-internal-symbols",
|
|
"-I",
|
|
"dir1",
|
|
"-I",
|
|
"dir2",
|
|
"-I",
|
|
"dir5=dir3",
|
|
],
|
|
snapshot,
|
|
)
|