lib/tests/misc: don't import nixpkgs

(cherry picked from commit 74799dd97c)
This commit is contained in:
Sergei Zimmerman
2025-08-14 19:10:08 +03:00
committed by github-actions[bot]
parent b0401fdfb8
commit e888a09931

View File

@@ -145,6 +145,11 @@ let
inherit expected;
};
dummyDerivation = derivation {
name = "name";
builder = "builder";
system = "system";
};
in
runTests {
@@ -782,13 +787,7 @@ runTests {
};
testSplitStringsDerivation = {
expr = take 3 (
strings.splitString "/" (derivation {
name = "name";
builder = "builder";
system = "system";
})
);
expr = take 3 (strings.splitString "/" dummyDerivation);
expected = [
""
"nix"
@@ -841,7 +840,7 @@ runTests {
in
{
storePath = isStorePath goodPath;
storePathDerivation = isStorePath (import ../.. { system = "x86_64-linux"; }).hello;
storePathDerivation = isStorePath dummyDerivation;
storePathAppendix = isStorePath "${goodPath}/bin/python";
nonAbsolute = isStorePath (concatStrings (tail (stringToCharacters goodPath)));
asPath = isStorePath (/. + goodPath);
@@ -926,7 +925,7 @@ runTests {
};
testHasInfixDerivation = {
expr = hasInfix "hello" (import ../.. { system = "x86_64-linux"; }).hello;
expr = hasInfix "name" dummyDerivation;
expected = true;
};