Use a more realistic example that exercises all encodings

... as suggested by @roberth

This also caught a bug in rendering lists, which this change also fixes
This commit is contained in:
Gabriel Gonzalez
2019-12-15 08:21:41 -08:00
parent 693096d283
commit 5edd4dd44c
2 changed files with 28 additions and 9 deletions
+10 -6
View File
@@ -445,17 +445,21 @@ runTests {
expr =
encodeGNUCommandLine
{ }
{ foo = "A";
{ data = builtins.toJSON { id = 0; };
bar = 1;
X = "PUT";
baz = null;
retry = 3;
qux = true;
retry-delay = null;
v = true;
url = [ "https://example.com/foo" "https://example.com/bar" ];
silent = false;
verbose = true;
};
expected = " --bar '1' --foo 'A' --qux -v";
expected = " -X 'PUT' --data '{\"id\":0}' --retry '3' --url 'https://example.com/foo' --url 'https://example.com/bar' --verbose";
};
}