tree-wide: use cartesianProduct

This commit is contained in:
Gabriel Volpe 2024-04-15 19:13:22 +02:00
parent 228621e42d
commit 10517cf9ab
No known key found for this signature in database
GPG key ID: 121D4302A64B2261
3 changed files with 8 additions and 8 deletions

View file

@ -33,7 +33,7 @@ let
boolToString boolToString
callPackagesWith callPackagesWith
callPackageWith callPackageWith
cartesianProductOfSets cartesianProduct
cli cli
composeExtensions composeExtensions
composeManyExtensions composeManyExtensions
@ -1686,17 +1686,17 @@ runTests {
}; };
testCartesianProductOfEmptySet = { testCartesianProductOfEmptySet = {
expr = cartesianProductOfSets {}; expr = cartesianProduct {};
expected = [ {} ]; expected = [ {} ];
}; };
testCartesianProductOfOneSet = { testCartesianProductOfOneSet = {
expr = cartesianProductOfSets { a = [ 1 2 3 ]; }; expr = cartesianProduct { a = [ 1 2 3 ]; };
expected = [ { a = 1; } { a = 2; } { a = 3; } ]; expected = [ { a = 1; } { a = 2; } { a = 3; } ];
}; };
testCartesianProductOfTwoSets = { testCartesianProductOfTwoSets = {
expr = cartesianProductOfSets { a = [ 1 ]; b = [ 10 20 ]; }; expr = cartesianProduct { a = [ 1 ]; b = [ 10 20 ]; };
expected = [ expected = [
{ a = 1; b = 10; } { a = 1; b = 10; }
{ a = 1; b = 20; } { a = 1; b = 20; }
@ -1704,12 +1704,12 @@ runTests {
}; };
testCartesianProductOfTwoSetsWithOneEmpty = { testCartesianProductOfTwoSetsWithOneEmpty = {
expr = cartesianProductOfSets { a = [ ]; b = [ 10 20 ]; }; expr = cartesianProduct { a = [ ]; b = [ 10 20 ]; };
expected = [ ]; expected = [ ];
}; };
testCartesianProductOfThreeSets = { testCartesianProductOfThreeSets = {
expr = cartesianProductOfSets { expr = cartesianProduct {
a = [ 1 2 3 ]; a = [ 1 2 3 ];
b = [ 10 20 30 ]; b = [ 10 20 30 ];
c = [ 100 200 300 ]; c = [ 100 200 300 ];

View file

@ -5,7 +5,7 @@
let let
inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest; inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
testCombinations = pkgs.lib.cartesianProductOfSets { testCombinations = pkgs.lib.cartesianProduct {
predictable = [true false]; predictable = [true false];
withNetworkd = [true false]; withNetworkd = [true false];
systemdStage1 = [true false]; systemdStage1 = [true false];

View file

@ -70,7 +70,7 @@ stdenv.mkDerivation rec {
maintainers = [ maintainers.sternenseemann ]; maintainers = [ maintainers.sternenseemann ];
homepage = "https://github.com/mirage/ocaml-freestanding"; homepage = "https://github.com/mirage/ocaml-freestanding";
platforms = builtins.map ({ arch, os }: "${arch}-${os}") platforms = builtins.map ({ arch, os }: "${arch}-${os}")
(cartesianProductOfSets { (cartesianProduct {
arch = [ "aarch64" "x86_64" ]; arch = [ "aarch64" "x86_64" ];
os = [ "linux" ]; os = [ "linux" ];
} ++ [ } ++ [