diff options
author | Robert Hensing <robert@roberthensing.nl> | 2022-04-04 14:20:53 +0200 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2022-04-04 14:24:15 +0200 |
commit | 337c72b5cde3a034e92cc6c99865869774be7d47 (patch) | |
tree | 624249b65172fa922ce106d515180dba9bbe389f /pkgs/pkgs-lib/tests | |
parent | 46156529f2682412b8867f7bc40b32b350a00bd9 (diff) | |
download | nixpkgs-337c72b5cde3a034e92cc6c99865869774be7d47.tar nixpkgs-337c72b5cde3a034e92cc6c99865869774be7d47.tar.gz nixpkgs-337c72b5cde3a034e92cc6c99865869774be7d47.tar.bz2 nixpkgs-337c72b5cde3a034e92cc6c99865869774be7d47.tar.lz nixpkgs-337c72b5cde3a034e92cc6c99865869774be7d47.tar.xz nixpkgs-337c72b5cde3a034e92cc6c99865869774be7d47.tar.zst nixpkgs-337c72b5cde3a034e92cc6c99865869774be7d47.zip |
pkgs.formats.javaProperties: Add type coercions
A usability improvement.
Diffstat (limited to 'pkgs/pkgs-lib/tests')
-rw-r--r-- | pkgs/pkgs-lib/tests/formats.nix | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/pkgs/pkgs-lib/tests/formats.nix b/pkgs/pkgs-lib/tests/formats.nix index 25327acfe7a..86ef4c6d269 100644 --- a/pkgs/pkgs-lib/tests/formats.nix +++ b/pkgs/pkgs-lib/tests/formats.nix @@ -176,11 +176,21 @@ in runBuildTests { ''; }; - # See also java-properties/default.nix for more complete tests + # This test is responsible for + # 1. testing type coercions + # 2. providing a more readable example test + # Whereas java-properties/default.nix tests the low level escaping, etc. testJavaProperties = { drv = evalFormat formats.javaProperties {} { + floaty = 3.1415; + tautologies = true; + contradictions = false; foo = "bar"; - "1" = "2"; + # # Disallowed at eval time, because it's ambiguous: + # # add to store or convert to string? + # root = /root; + "1" = 2; + package = pkgs.hello; "ütf 8" = "dûh"; # NB: Some editors (vscode) show this _whole_ line in right-to-left order "الجبر" = "أكثر من مجرد أرقام"; @@ -189,7 +199,11 @@ in runBuildTests { # Generated with Nix 1 = 2 + contradictions = false + floaty = 3.141500 foo = bar + package = ${pkgs.hello} + tautologies = true \u00fctf\ 8 = d\u00fbh \u0627\u0644\u062c\u0628\u0631 = \u0623\u0643\u062b\u0631 \u0645\u0646 \u0645\u062c\u0631\u062f \u0623\u0631\u0642\u0627\u0645 ''; |