about summary refs log tree commit diff
path: root/pkgs/test/overriding.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/test/overriding.nix')
-rw-r--r--pkgs/test/overriding.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/pkgs/test/overriding.nix b/pkgs/test/overriding.nix
new file mode 100644
index 0000000000000..eab710af5afab
--- /dev/null
+++ b/pkgs/test/overriding.nix
@@ -0,0 +1,23 @@
+{ lib, pkgs, stdenvNoCC }:
+
+let
+  tests =
+    let
+      p = pkgs.python3Packages.xpybutil.overridePythonAttrs (_: { dontWrapPythonPrograms = true; });
+    in
+    [
+      ({
+        name = "overridePythonAttrs";
+        expr = !lib.hasInfix "wrapPythonPrograms" p.postFixup;
+        expected = true;
+      })
+    ];
+in
+
+stdenvNoCC.mkDerivation {
+  name = "test-overriding";
+  passthru = { inherit tests; };
+  buildCommand = ''
+    touch $out
+  '' + lib.concatMapStringsSep "\n" (t: "([[ ${lib.boolToString t.expr} == ${lib.boolToString t.expected} ]] && echo '${t.name} success') || (echo '${t.name} fail' && exit 1)") tests;
+}