WIP: dont merge
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
# tests for the nixos options to jsonschema converter
|
||||
# run these tests via `nix-unit ./test.nix`
|
||||
{
|
||||
lib ? (import <nixpkgs> { }).lib,
|
||||
lib ? import /home/johannes/git/nixpkgs/lib,
|
||||
# lib ? (import <nixpkgs> { }).lib,
|
||||
slib ? (import ./. { inherit lib; }),
|
||||
}:
|
||||
let
|
||||
@@ -67,31 +68,38 @@ in
|
||||
};
|
||||
};
|
||||
};
|
||||
test_no_default = {
|
||||
expr = stableView (
|
||||
slib.getPrios {
|
||||
options =
|
||||
(eval [
|
||||
{
|
||||
options.foo.bar = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
};
|
||||
}
|
||||
]).options;
|
||||
}
|
||||
);
|
||||
expected = {
|
||||
foo = {
|
||||
bar = {
|
||||
__this = {
|
||||
files = [ ];
|
||||
prio = 9999;
|
||||
total = false;
|
||||
test_no_default =
|
||||
let
|
||||
|
||||
configuration = (
|
||||
eval [
|
||||
{
|
||||
options.foo.bar = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
};
|
||||
}
|
||||
]
|
||||
);
|
||||
in
|
||||
{
|
||||
inherit configuration;
|
||||
expr = stableView (
|
||||
slib.getPrios {
|
||||
options = configuration.options;
|
||||
}
|
||||
);
|
||||
expected = {
|
||||
foo = {
|
||||
bar = {
|
||||
__this = {
|
||||
files = [ ];
|
||||
prio = 9999;
|
||||
total = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
test_submodule = {
|
||||
expr = stableView (
|
||||
|
||||
Reference in New Issue
Block a user