buildClan: add more eager tests
This commit is contained in:
@@ -10,9 +10,30 @@ let
|
|||||||
inherit lib nixpkgs clan-core;
|
inherit lib nixpkgs clan-core;
|
||||||
self = ./.;
|
self = ./.;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Shallowly force all attribute values to be evaluated.
|
||||||
|
shallowForceAllAttributes = lib.foldlAttrs (
|
||||||
|
_acc: _name: value:
|
||||||
|
lib.seq value true
|
||||||
|
) true;
|
||||||
in
|
in
|
||||||
#######
|
#######
|
||||||
{
|
{
|
||||||
|
test_missing_self =
|
||||||
|
let
|
||||||
|
config = buildClan {
|
||||||
|
meta.name = "test";
|
||||||
|
imports = [ ./module.nix ];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
expr = shallowForceAllAttributes config;
|
||||||
|
expectedError = {
|
||||||
|
type = "ThrownError";
|
||||||
|
msg = "A definition for option `directory' is not of type `path*";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
test_only_required =
|
test_only_required =
|
||||||
let
|
let
|
||||||
config = evalClan {
|
config = evalClan {
|
||||||
@@ -25,7 +46,7 @@ in
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
expr = config.inventory ? meta;
|
expr = shallowForceAllAttributes config;
|
||||||
expected = true;
|
expected = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user