diff options
author | lucasew <lucas59356@gmail.com> | 2021-08-13 16:31:14 -0300 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2021-08-25 14:02:59 +0200 |
commit | 83514ae7a9f25023c2bc7bec323e661b7302d61d (patch) | |
tree | e834ae9a1c2304d8016d1d92466ae884d802b8e3 /pkgs/pkgs-lib/tests/formats.nix | |
parent | 346d5ce8a087cdd6a35c1fd34ee33c6bb79f2058 (diff) | |
download | nixlib-83514ae7a9f25023c2bc7bec323e661b7302d61d.tar nixlib-83514ae7a9f25023c2bc7bec323e661b7302d61d.tar.gz nixlib-83514ae7a9f25023c2bc7bec323e661b7302d61d.tar.bz2 nixlib-83514ae7a9f25023c2bc7bec323e661b7302d61d.tar.lz nixlib-83514ae7a9f25023c2bc7bec323e661b7302d61d.tar.xz nixlib-83514ae7a9f25023c2bc7bec323e661b7302d61d.tar.zst nixlib-83514ae7a9f25023c2bc7bec323e661b7302d61d.zip |
lib.formats.yaml: use well known YAML format
The way `(lib.formats.yaml {}).generate` generates YAML is compliant because on YAML 1.2 spec JSON is a subset of YAML but it bugs people's minds and can lead to problems with software that is not compatible with YAML 1.2. This commit also changes the test of the generation function. Data validation/typing remains the same. See #133802. Signed-off-by: lucasew <lucas59356@gmail.com>
Diffstat (limited to 'pkgs/pkgs-lib/tests/formats.nix')
-rw-r--r-- | pkgs/pkgs-lib/tests/formats.nix | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/pkgs/pkgs-lib/tests/formats.nix b/pkgs/pkgs-lib/tests/formats.nix index af19f6100eef..14cc85eff31d 100644 --- a/pkgs/pkgs-lib/tests/formats.nix +++ b/pkgs/pkgs-lib/tests/formats.nix @@ -72,21 +72,17 @@ in runBuildTests { path = ./formats.nix; }; expected = '' - { - "attrs": { - "foo": null - }, - "false": false, - "float": 3.141, - "list": [ - null, - null - ], - "null": null, - "path": "${./formats.nix}", - "str": "foo", - "true": true - } + attrs: + foo: null + 'false': false + float: 3.141 + list: + - null + - null + 'null': null + path: ${./formats.nix} + str: foo + 'true': true ''; }; |