WIP: dont merge

This commit is contained in:
Johannes Kirschbauer
2025-10-03 11:36:23 +02:00
parent 1465b18820
commit 1f13ce2732
4 changed files with 254 additions and 24 deletions

View File

@@ -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 (