Merge pull request #223407 from AngryAnt/toplist-path

lib.toPlist: Add support for path values
This commit is contained in:
toonn
2023-05-05 21:15:23 +02:00
committed by GitHub
4 changed files with 76 additions and 0 deletions

View File

@@ -919,6 +919,30 @@ runTests {
expected = "«foo»";
};
testToPlist =
let
deriv = derivation { name = "test"; builder = "/bin/sh"; system = "aarch64-linux"; };
in {
expr = mapAttrs (const (generators.toPlist { })) {
value = {
nested.values = rec {
int = 42;
float = 0.1337;
bool = true;
emptystring = "";
string = "fn\${o}\"r\\d";
newlinestring = "\n";
path = /. + "/foo";
null_ = null;
list = [ 3 4 "test" ];
emptylist = [];
attrs = { foo = null; "foo b/ar" = "baz"; };
emptyattrs = {};
};
};
};
expected = { value = builtins.readFile ./test-to-plist-expected.plist; };
};
testToLuaEmptyAttrSet = {
expr = generators.toLua {} {};