mirror of
https://github.com/TangentFoxy/argparse.git
synced 2025-07-28 02:52:20 +00:00
Fixed exploded tests to work with busted 2.0
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local Parser = require "argparse"
|
||||
getmetatable(Parser()).error = function(_, msg) error(msg) end
|
||||
|
||||
describe("tests related to actions", function()
|
||||
it("calls actions for options", function()
|
||||
|
@@ -1,4 +1,5 @@
|
||||
local Parser = require "argparse"
|
||||
getmetatable(Parser()).error = function(_, msg) error(msg) end
|
||||
|
||||
describe("tests related to positional arguments", function()
|
||||
describe("passing correct arguments", function()
|
||||
|
@@ -1,4 +1,5 @@
|
||||
local Parser = require "argparse"
|
||||
getmetatable(Parser()).error = function(_, msg) error(msg) end
|
||||
|
||||
describe("tests related to commands", function()
|
||||
it("handles commands after arguments", function()
|
||||
|
@@ -1,4 +1,5 @@
|
||||
local Parser = require "argparse"
|
||||
getmetatable(Parser()).error = function(_, msg) error(msg) end
|
||||
|
||||
describe("tests related to converters", function()
|
||||
it("converts arguments", function()
|
||||
|
@@ -1,4 +1,5 @@
|
||||
local Parser = require "argparse"
|
||||
getmetatable(Parser()).error = function(_, msg) error(msg) end
|
||||
|
||||
describe("tests related to default values", function()
|
||||
describe("default values for arguments", function()
|
||||
|
@@ -1,4 +1,5 @@
|
||||
local Parser = require "argparse"
|
||||
getmetatable(Parser()).error = function(_, msg) error(msg) end
|
||||
|
||||
describe("tests related to help message generation", function()
|
||||
it("creates correct help message for empty parser", function()
|
||||
|
@@ -1,5 +1,3 @@
|
||||
local Parser = require "argparse"
|
||||
|
||||
describe("tests related to CLI behaviour #unsafe", function()
|
||||
describe("error messages", function()
|
||||
it("generates correct error message without arguments", function()
|
||||
|
@@ -1,4 +1,5 @@
|
||||
local Parser = require "argparse"
|
||||
getmetatable(Parser()).error = function(_, msg) error(msg) end
|
||||
|
||||
describe("tests related to mutexes", function()
|
||||
it("handles mutex correctly", function()
|
||||
|
@@ -1,4 +1,5 @@
|
||||
local Parser = require "argparse"
|
||||
getmetatable(Parser()).error = function(_, msg) error(msg) end
|
||||
|
||||
describe("tests related to options", function()
|
||||
describe("passing correct options", function()
|
||||
|
@@ -1,4 +1,5 @@
|
||||
local Parser = require "argparse"
|
||||
getmetatable(Parser()).error = function(_, msg) error(msg) end
|
||||
|
||||
describe("tests related to :pparse()", function()
|
||||
it("returns true and result on success", function()
|
||||
|
@@ -1,4 +1,5 @@
|
||||
local Parser = require "argparse"
|
||||
getmetatable(Parser()).error = function(_, msg) error(msg) end
|
||||
|
||||
describe("tests related to tips", function()
|
||||
describe("provides tips when data is too long", function()
|
||||
|
@@ -1,4 +1,5 @@
|
||||
local Parser = require "argparse"
|
||||
getmetatable(Parser()).error = function(_, msg) error(msg) end
|
||||
|
||||
describe("tests related to usage message generation", function()
|
||||
it("creates correct usage message for empty parser", function()
|
||||
|
@@ -941,12 +941,8 @@ function Parser:_parse(args, errhandler)
|
||||
end
|
||||
|
||||
function Parser:error(msg)
|
||||
if _TEST then
|
||||
error(msg)
|
||||
else
|
||||
io.stderr:write(("%s\r\n\r\nError: %s\r\n"):format(self:get_usage(), msg))
|
||||
os.exit(1)
|
||||
end
|
||||
io.stderr:write(("%s\r\n\r\nError: %s\r\n"):format(self:get_usage(), msg))
|
||||
os.exit(1)
|
||||
end
|
||||
|
||||
function Parser:parse(args)
|
||||
|
Reference in New Issue
Block a user