Skip to content

Commit

Permalink
lib.cli.toGNUCommandLine: add wrapped test
Browse files Browse the repository at this point in the history
  • Loading branch information
llakala committed Jan 13, 2025
1 parent 032647e commit 86e73c3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/tests/misc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1832,6 +1832,27 @@ runTests {
];
};

testToGNUCommandLineWrapped = {
expr = cli.toGNUCommandLine { wrappingValueString = "\""; } {
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 = cli.toGNUCommandLineShell {} {
data = builtins.toJSON { id = 0; };
Expand Down

0 comments on commit 86e73c3

Please sign in to comment.