mirror of
https://github.com/TangentFoxy/argparse.git
synced 2025-07-28 02:52:20 +00:00
Fix some line length warnings
This commit is contained in:
@@ -275,13 +275,17 @@ describe("tests related to options", function()
|
||||
it("handles too many arguments correctly", function()
|
||||
local parser = Parser()
|
||||
parser:option "-s" "--server"
|
||||
assert.has_error(function() parser:parse{"-sfoo", "bar"} end, "too many arguments")
|
||||
assert.has_error(function()
|
||||
parser:parse{"-sfoo", "bar"}
|
||||
end, "too many arguments")
|
||||
end)
|
||||
|
||||
it("doesn't accept GNU-like long options when it doesn't need arguments", function()
|
||||
local parser = Parser()
|
||||
parser:flag "-q" "--quiet"
|
||||
assert.has_error(function() parser:parse{"--quiet=very_quiet"} end, "option '--quiet' does not take arguments")
|
||||
assert.has_error(function()
|
||||
parser:parse{"--quiet=very_quiet"}
|
||||
end, "option '--quiet' does not take arguments")
|
||||
end)
|
||||
|
||||
it("handles too many invocations correctly", function()
|
||||
@@ -290,7 +294,9 @@ describe("tests related to options", function()
|
||||
count = 1,
|
||||
overwrite = false
|
||||
}
|
||||
assert.has_error(function() parser:parse{"-qq"} end, "option '-q' must be used 1 time")
|
||||
assert.has_error(function()
|
||||
parser:parse{"-qq"}
|
||||
end, "option '-q' must be used 1 time")
|
||||
end)
|
||||
|
||||
it("handles too few invocations correctly", function()
|
||||
@@ -298,8 +304,12 @@ describe("tests related to options", function()
|
||||
parser:option "-f" "--foo" {
|
||||
count = "3-4"
|
||||
}
|
||||
assert.has_error(function() parser:parse{"-fFOO", "--foo=BAR"} end, "option '--foo' must be used at least 3 times")
|
||||
assert.has_error(function() parser:parse{} end, "missing option '-f'")
|
||||
assert.has_error(function()
|
||||
parser:parse{"-fFOO", "--foo=BAR"}
|
||||
end, "option '--foo' must be used at least 3 times")
|
||||
assert.has_error(
|
||||
function() parser:parse{}
|
||||
end, "missing option '-f'")
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user