nixops_unstable_*: Test addAvailablePlugins and withPlugins commute
Actually the lack of instantiation is the main purpose, but it's nice to test commutativity too. (Even if it's just one example...)
This commit is contained in:
parent
5a1285c216
commit
114af421c5
1 changed files with 8 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
{ lib, python3 }:
|
||||
{ lib, python3, emptyFile }:
|
||||
|
||||
let
|
||||
inherit (lib) extends;
|
||||
|
@ -64,6 +64,13 @@ let
|
|||
nixos = this.rawPackage.tests.nixos.passthru.override {
|
||||
nixopsPkg = this.rawPackage;
|
||||
};
|
||||
commutative_addAvailablePlugins_withPlugins =
|
||||
assert
|
||||
(this.public.addAvailablePlugins (self: super: { inherit emptyFile; })).withPlugins (ps: [ emptyFile ])
|
||||
==
|
||||
# Note that this value proves that the package is not instantiated until the end, where it's valid again.
|
||||
(this.public.withPlugins (ps: [ emptyFile ])).addAvailablePlugins (self: super: { inherit emptyFile; });
|
||||
emptyFile;
|
||||
}
|
||||
# Make sure we also test with a configuration that's been extended with a plugin.
|
||||
// lib.optionalAttrs (this.selectedPlugins == [ ]) {
|
||||
|
|
Loading…
Reference in a new issue