summary refs log tree commit diff
path: root/lib/tests
diff options
context:
space:
mode:
authorRobert Hensing <roberth@users.noreply.github.com>2020-01-14 12:04:05 +0100
committerGitHub <noreply@github.com>2020-01-14 12:04:05 +0100
commit8da81465c19fca393a3b17004c743e4d82a98e4f (patch)
tree3e2824a04be40528809a581346cb0f10682033e1 /lib/tests
parente306ee4a56eeb60eb38e97a33e65a769b0e99ad1 (diff)
parenta46679facd38ef7031ea3a79def60b98e384f155 (diff)
Merge pull request #75539 from Gabriel439/gabriel/renderOptions
Add `pkgs.lib.encodeGNUCommandLine`
Diffstat (limited to 'lib/tests')
-rw-r--r--lib/tests/misc.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix
index b064faa1e1ba6..e47b48b5017d1 100644
--- a/lib/tests/misc.nix
+++ b/lib/tests/misc.nix
@@ -441,4 +441,25 @@ runTests {
     expected  = "«foo»";
   };
 
+  testRenderOptions = {
+    expr =
+       encodeGNUCommandLine
+         { }
+         { data = builtins.toJSON { id = 0; };
+
+           X = "PUT";
+
+           retry = 3;
+
+           retry-delay = null;
+
+           url = [ "https://example.com/foo" "https://example.com/bar" ];
+
+           silent = false;
+
+           verbose = true;
+         };
+
+    expected = "'-X' 'PUT' '--data' '{\"id\":0}' '--retry' '3' '--url' 'https://example.com/foo' '--url' 'https://example.com/bar' '--verbose'";
+  };
 }