mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
lib/tests: add test for pkgsText parameter and package set selection of mkPackageOption
This commit is contained in:
parent
f07537da75
commit
55ab538abf
@ -235,6 +235,8 @@ checkConfigOutput '^".*Example extra description\..*"$' options.packageWithExtra
|
||||
checkConfigError 'The option .undefinedPackage. is used but not defined' config.undefinedPackage ./declare-mkPackageOption.nix
|
||||
checkConfigOutput '^null$' config.nullablePackage ./declare-mkPackageOption.nix
|
||||
checkConfigOutput '^"null or package"$' options.nullablePackageWithDefault.type.description ./declare-mkPackageOption.nix
|
||||
checkConfigOutput '^"myPkgs\.hello"$' options.packageWithPkgsText.defaultText.text ./declare-mkPackageOption.nix
|
||||
checkConfigOutput '^"hello-other"$' options.packageFromOtherSet.default.pname ./declare-mkPackageOption.nix
|
||||
|
||||
# submoduleWith
|
||||
|
||||
|
@ -41,5 +41,13 @@ in {
|
||||
nullablePackageWithDefault = lib.mkPackageOption pkgs "hello" {
|
||||
nullable = true;
|
||||
};
|
||||
|
||||
packageWithPkgsText = lib.mkPackageOption pkgs "hello" {
|
||||
pkgsText = "myPkgs";
|
||||
};
|
||||
|
||||
packageFromOtherSet = let myPkgs = {
|
||||
hello = pkgs.hello // { pname = "hello-other"; };
|
||||
}; in lib.mkPackageOption myPkgs "hello" { };
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user