2021-06-14 10:47:39 +02:00
|
|
|
{
|
|
|
|
description = "Flake utils demo";
|
|
|
|
|
|
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
|
|
|
inherit (flake-utils.lib.check-utils system) isEqual hasKey;
|
2021-06-16 22:35:21 +02:00
|
|
|
testDataset = { key1 = "value1"; key2 = 123; key3 = "some>value with^invalid&characters"; };
|
2021-06-14 10:47:39 +02:00
|
|
|
in
|
|
|
|
rec {
|
|
|
|
checks = {
|
2021-06-16 22:35:21 +02:00
|
|
|
# Successful cases
|
|
|
|
success_isEqual = isEqual testDataset.key1 "value1";
|
|
|
|
success_hasKey = hasKey testDataset "key2";
|
2021-06-14 10:47:39 +02:00
|
|
|
|
2021-06-16 22:35:21 +02:00
|
|
|
# Failing cases
|
|
|
|
failure_isEqual = isEqual testDataset.key1 "failing-data";
|
|
|
|
failure_hasKey = hasKey testDataset "failing-data";
|
2021-06-14 10:47:39 +02:00
|
|
|
|
2021-06-16 22:35:21 +02:00
|
|
|
# Formatting
|
|
|
|
formatting_number = isEqual testDataset.key2 123;
|
|
|
|
formatting_null = isEqual null null;
|
|
|
|
formatting_invalid_chars = isEqual testDataset.key3 "some>value with^invalid&characters";
|
2021-06-14 10:47:39 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|