mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-11 18:32:23 +08:00
lib/tests/misc: don't import nixpkgs
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user