about summary refs log tree commit diff
path: root/lib/tests
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2023-10-31 17:29:15 +0100
committerGitHub <noreply@github.com>2023-10-31 17:29:15 +0100
commite55ee23bf6814213acc792933004abbf4a9f0a71 (patch)
tree31d5682774734a6d7b4edf771961ee31e8c1ae24 /lib/tests
parent5d1e7ab8f809b51e521559b744cb6ef40468aff3 (diff)
parentd2161d06321770f37fd86bfa15296dd8de0196a0 (diff)
downloadnixlib-e55ee23bf6814213acc792933004abbf4a9f0a71.tar
nixlib-e55ee23bf6814213acc792933004abbf4a9f0a71.tar.gz
nixlib-e55ee23bf6814213acc792933004abbf4a9f0a71.tar.bz2
nixlib-e55ee23bf6814213acc792933004abbf4a9f0a71.tar.lz
nixlib-e55ee23bf6814213acc792933004abbf4a9f0a71.tar.xz
nixlib-e55ee23bf6814213acc792933004abbf4a9f0a71.tar.zst
nixlib-e55ee23bf6814213acc792933004abbf4a9f0a71.zip
Merge pull request #260971 from Gerg-L/getExe
lib.getExe': check arguments
Diffstat (limited to 'lib/tests')
-rw-r--r--lib/tests/misc.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix
index 2e7fda2b1f8b..47853f47278a 100644
--- a/lib/tests/misc.nix
+++ b/lib/tests/misc.nix
@@ -1906,4 +1906,32 @@ runTests {
     expr = (with types; either int (listOf (either bool str))).description;
     expected = "signed integer or list of (boolean or string)";
   };
+
+# Meta
+  testGetExe'Output = {
+    expr = getExe' {
+      type = "derivation";
+      out = "somelonghash";
+      bin = "somelonghash";
+    } "executable";
+    expected = "somelonghash/bin/executable";
+  };
+
+  testGetExeOutput = {
+    expr = getExe {
+      type = "derivation";
+      out = "somelonghash";
+      bin = "somelonghash";
+      meta.mainProgram = "mainProgram";
+    };
+    expected = "somelonghash/bin/mainProgram";
+  };
+
+  testGetExe'FailureFirstArg = testingThrow (
+    getExe' "not a derivation" "executable"
+  );
+
+  testGetExe'FailureSecondArg = testingThrow (
+    getExe' { type = "derivation"; } "dir/executable"
+  );
 }