testers.testEqualArrayOrMap: use default.nix and move recurseIntoAttrs into tests.nix

This commit is contained in:
Connor Baker
2025-03-03 16:30:15 +00:00
parent abf9e606cf
commit 4e6be8f313
4 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -72,7 +72,7 @@
# See https://nixos.org/manual/nixpkgs/unstable/#tester-testEqualArrayOrMap
# or doc/build-helpers/testers.chapter.md
# NOTE: Must be `import`-ed rather than `callPackage`-d to preserve the `override` attribute.
testEqualArrayOrMap = import ./testEqualArrayOrMap/tester.nix { inherit lib stdenvNoCC; };
testEqualArrayOrMap = import ./testEqualArrayOrMap { inherit lib stdenvNoCC; };
# See https://nixos.org/manual/nixpkgs/unstable/#tester-testVersion
# or doc/build-helpers/testers.chapter.md
+1 -1
View File
@@ -357,5 +357,5 @@ lib.recurseIntoAttrs {
'';
};
testEqualArrayOrMap = lib.recurseIntoAttrs (pkgs.callPackages ../testEqualArrayOrMap/tests.nix { });
testEqualArrayOrMap = pkgs.callPackages ../testEqualArrayOrMap/tests.nix { };
}
@@ -2,8 +2,13 @@
# `testers.testBuildFailure`. This is due to the fact that `testers.testBuildFailure` modifies the derivation such that
# it produces an output containing the exit code, logs, and other things. Since `testers.runCommand` expects the empty
# derivation, it produces a hash mismatch.
{ runCommand, testers, ... }:
{
lib,
runCommand,
testers,
}:
let
inherit (lib.attrsets) recurseIntoAttrs;
inherit (testers) testEqualArrayOrMap testBuildFailure;
concatValuesArrayToActualArray = ''
nixLog "appending all values in valuesArray to actualArray"
@@ -18,7 +23,7 @@ let
done
'';
in
{
recurseIntoAttrs {
# NOTE: This particular test is used in the docs:
# See https://nixos.org/manual/nixpkgs/unstable/#tester-testEqualArrayOrMap
# or doc/build-helpers/testers.chapter.md