pkgs.format.toml: introduce test for checking semantics

This commit is contained in:
Luiz Ribeiro 2023-07-27 09:40:16 -04:00
parent f68995642f
commit ffb9b68bd3
No known key found for this signature in database
GPG key ID: BF6F8043AC280E02

View file

@ -219,6 +219,35 @@ in runBuildTests {
'';
};
# see https://github.com/NixOS/nixpkgs/issues/237521 for this particular test
testTomlSemantics = {
drv = evalFormat formats.toml {} {
processors = {
override = [
{ tags = { cluster = "staging"; }; }
];
rename = [
{
replace = [
{ dest = "ceph_telegraf_check"; measurement = "exec"; }
];
}
];
};
};
expected = ''
[processors]
[[processors.override]]
[processors.override.tags]
cluster = "staging"
[[processors.rename]]
[[processors.rename.replace]]
dest = "ceph_telegraf_check"
measurement = "exec"
'';
};
# This test is responsible for
# 1. testing type coercions
# 2. providing a more readable example test