mirror of
https://github.com/TangentFoxy/argparse.git
synced 2025-07-28 11:02:20 +00:00
Add a test for a automatic invocation of underused option with default value
This commit is contained in:
@@ -131,5 +131,16 @@ describe("tests related to default values", function()
|
|||||||
local args = parser:parse({"-f", "--foo=baz", "--foo"})
|
local args = parser:parse({"-f", "--foo=baz", "--foo"})
|
||||||
assert.same({foo = {"bar", "baz", "bar"}}, args)
|
assert.same({foo = {"bar", "baz", "bar"}}, args)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it("completes missing invocations for multi-count options with default argument", function()
|
||||||
|
local parser = Parser()
|
||||||
|
parser:option "-f" "--foo" {
|
||||||
|
count = "2",
|
||||||
|
default = "bar",
|
||||||
|
defmode = "arg"
|
||||||
|
}
|
||||||
|
local args = parser:parse({"-ffff"})
|
||||||
|
assert.same({foo = {"fff", "bar"}}, args)
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user