diff options
Diffstat (limited to 'lib/tests')
-rw-r--r-- | lib/tests/misc.nix | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index e47b48b5017d..b320839b2ac7 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -441,9 +441,34 @@ runTests { expected = "«foo»"; }; - testRenderOptions = { + +# CLI + + testToGNUCommandLine = { + expr = + cli.toGNUCommandLine + { } + { 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" ]; + }; + + testToGNUCommandLineShell = { expr = - encodeGNUCommandLine + cli.toGNUCommandLineShell { } { data = builtins.toJSON { id = 0; }; |