From 21784ddc118fb82a162f08162167ff9b609b7250 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 12 Oct 2021 14:54:04 +0200 Subject: util.argparse: Add test for #1691 --- spec/util_argparse_spec.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spec/util_argparse_spec.lua') diff --git a/spec/util_argparse_spec.lua b/spec/util_argparse_spec.lua index 6b024249..3994a041 100644 --- a/spec/util_argparse_spec.lua +++ b/spec/util_argparse_spec.lua @@ -43,4 +43,11 @@ describe("parse", function() assert.equal("--foo", where); end); + it("reports where the problem is", function() + local opts, err, where = parse({ "-h" }); + assert.falsy(opts); + assert.equal("param-not-found", err); + assert.equal("-h", where, "returned where"); + end); + end); -- cgit v1.2.3