pkgs-lib/formats: revert to remarshal for toml
This commit is contained in:
@@ -471,7 +471,7 @@ recurseIntoAttrs {
|
||||
toml = expectDataEqual {
|
||||
file = writeTOML "data.toml" { hello = "world"; };
|
||||
expected = ''
|
||||
hello = 'world'
|
||||
hello = "world"
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
@@ -461,18 +461,16 @@ optionalAttrs allowAliases aliases
|
||||
generate =
|
||||
name: value:
|
||||
pkgs.callPackage (
|
||||
{ runCommand, go-toml }:
|
||||
{ runCommand, remarshal }:
|
||||
runCommand name
|
||||
{
|
||||
nativeBuildInputs = [ go-toml ];
|
||||
nativeBuildInputs = [ remarshal ];
|
||||
value = builtins.toJSON value;
|
||||
passAsFile = [ "value" ];
|
||||
preferLocalBuild = true;
|
||||
}
|
||||
# -use-json-number: preserve JSON ints as TOML ints
|
||||
# (Go's json.Decoder defaults to float64 for all numbers)
|
||||
''
|
||||
jsontoml -use-json-number < "$valuePath" > "$out"
|
||||
json2toml "$valuePath" "$out"
|
||||
''
|
||||
) { };
|
||||
|
||||
|
||||
@@ -695,16 +695,14 @@ runBuildTests {
|
||||
float = 3.141
|
||||
int = 10
|
||||
list = [1, 2]
|
||||
str = 'foo'
|
||||
str = "foo"
|
||||
true = true
|
||||
|
||||
[attrs]
|
||||
foo = 'foo'
|
||||
foo = "foo"
|
||||
|
||||
[level1]
|
||||
[level1.level2]
|
||||
[level1.level2.level3]
|
||||
level4 = 'deep'
|
||||
level4 = "deep"
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -725,7 +723,7 @@ runBuildTests {
|
||||
];
|
||||
};
|
||||
expected = ''
|
||||
language-server = ['bash-language-server', {except-features = ['diagnostics'], name = 'typescript-language-server'}]
|
||||
language-server = ["bash-language-server", {except-features = ["diagnostics"], name = "typescript-language-server"}]
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -739,7 +737,7 @@ runBuildTests {
|
||||
"stack(x,n)" = "foobar";
|
||||
};
|
||||
expected = ''
|
||||
'stack(x,n)' = 'foobar'
|
||||
"stack(x,n)" = "foobar"
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user