about summary refs log tree commit diff
path: root/lib/tests
diff options
context:
space:
mode:
authorArtturi <Artturin@artturin.com>2024-03-03 21:07:56 +0200
committerGitHub <noreply@github.com>2024-03-03 21:07:56 +0200
commit961ddd92a18c9259dd041affacf1b42aadfeb46c (patch)
tree3f1b446ae6d8a0634f1952aa45796d856556b1df /lib/tests
parentc981cb00dd1a78970addf91aa8c381a8c45fddb4 (diff)
parent741377b30058c5742e5ae08b1d8a85bcc9aa6d55 (diff)
Merge pull request #177977 from thefloweringash/call-packages-with-function-args
lib/customization: propagate function arguments in callPackagesWith
Diffstat (limited to 'lib/tests')
-rw-r--r--lib/tests/misc.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix
index 193e68a96933c..041122feadae8 100644
--- a/lib/tests/misc.nix
+++ b/lib/tests/misc.nix
@@ -55,6 +55,24 @@ runTests {
     expected = { a = false; b = false; c = true; };
   };
 
+  testCallPackageWithOverridePreservesArguments =
+    let
+      f = { a ? 0, b }: {};
+      f' = callPackageWith { a = 1; b = 2; } f {};
+    in {
+      expr = functionArgs f'.override;
+      expected = functionArgs f;
+    };
+
+  testCallPackagesWithOverridePreservesArguments =
+    let
+      f = { a ? 0, b }: { nested = {}; };
+      f' = callPackagesWith { a = 1; b = 2; } f {};
+    in {
+      expr = functionArgs f'.nested.override;
+      expected = functionArgs f;
+    };
+
 # TRIVIAL
 
   testId = {