lib/tests/misc: don't import nixpkgs

This commit is contained in:
Sergei Zimmerman
2025-08-14 19:10:08 +03:00
parent abbcbdd863
commit 74799dd97c

View File

@@ -145,6 +145,11 @@ let
inherit expected;
};
dummyDerivation = derivation {
name = "name";
builder = "builder";
system = "system";
};
in
runTests {
@@ -757,13 +762,7 @@ runTests {
};
testSplitStringsDerivation = {
expr = take 3 (
strings.splitString "/" (derivation {
name = "name";
builder = "builder";
system = "system";
})
);
expr = take 3 (strings.splitString "/" dummyDerivation);
expected = [
""
"nix"
@@ -816,7 +815,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);
@@ -901,7 +900,7 @@ runTests {
};
testHasInfixDerivation = {
expr = hasInfix "hello" (import ../.. { system = "x86_64-linux"; }).hello;
expr = hasInfix "name" dummyDerivation;
expected = true;
};