Commit ce5e3113 authored by Silvan Mosberger's avatar Silvan Mosberger
Browse files

lib/tests: Make sure the submodule type description can be evaluated

In 2d45a628, the submodule type
description was amended with the freeformType description. This causes
all the modules passed to the submodule to be evaluated once on their
own, without any extra definitions from the config section. This means
that the specified modules need to be valid on their own, without any
undeclared options.

This commit adds a test that evaluates a submodules option description,
which would trigger the above problem for one of the tests, if it were
not fixed by this commit as well.

This is done because the next commit makes option evaluation a bit more
strict, which would also trigger this test failure, even though it's not
related to the change at all.
parent 68955fe6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -175,6 +175,9 @@ checkConfigOutput "true" config.submodule.config ./declare-submoduleWith-noshort
## submoduleWith should merge all modules in one swoop
checkConfigOutput "true" config.submodule.inner ./declare-submoduleWith-modules.nix
checkConfigOutput "true" config.submodule.outer ./declare-submoduleWith-modules.nix
# Should also be able to evaluate the type name (which evaluates freeformType,
# which evaluates all the modules defined by the type)
checkConfigOutput "submodule" options.submodule.type.description ./declare-submoduleWith-modules.nix

## Paths should be allowed as values and work as expected
checkConfigOutput "true" config.submodule.enable ./declare-submoduleWith-path.nix
+1 −3
Original line number Diff line number Diff line
@@ -8,9 +8,6 @@
            default = false;
          };
        }
        {
          outer = true;
        }
      ];
    };
    default = {};
@@ -25,6 +22,7 @@
    })
    {
      inner = true;
      outer = true;
    }
  ];
}