mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
lib/tests: add tests for getExe' and getExe
This commit is contained in:
parent
d7c49ca715
commit
d2161d0632
@ -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"
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user