From e888a099315b233307659bff4c60657445d65db5 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Thu, 14 Aug 2025 19:10:08 +0300 Subject: [PATCH] lib/tests/misc: don't import nixpkgs (cherry picked from commit 74799dd97cea1ae09d62d25124226d5f058130d5) --- lib/tests/misc.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index a44561fb1e69..0d6aa2c879e6 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -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; };