Inventory: add concrete use-case examples #1650
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -4,16 +4,9 @@
|
|||||||
lib ? (import <nixpkgs> { }).lib,
|
lib ? (import <nixpkgs> { }).lib,
|
||||||
slib ? import ./. { inherit lib; },
|
slib ? import ./. { inherit lib; },
|
||||||
}:
|
}:
|
||||||
let
|
|
||||||
evaledOptions =
|
|
||||||
let
|
|
||||||
evaledConfig = lib.evalModules { modules = [ ./example-interface.nix ]; };
|
|
||||||
in
|
|
||||||
evaledConfig.options;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
testParseOptions = {
|
testParseOptions = {
|
||||||
expr = slib.parseOptions evaledOptions;
|
expr = slib.parseModule ./example-interface.nix;
|
||||||
expected = builtins.fromJSON (builtins.readFile ./example-schema.json);
|
expected = builtins.fromJSON (builtins.readFile ./example-schema.json);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user