aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-10-12 14:54:04 +0200
committerKim Alvefur <zash@zash.se>2021-10-12 14:54:04 +0200
commit21784ddc118fb82a162f08162167ff9b609b7250 (patch)
treeb6edd38996ae3b92ca8870bb5afbc184d51c0462
parent0c99443297976ed3ff83ec07c0301da830d6eb24 (diff)
downloadprosody-21784ddc118fb82a162f08162167ff9b609b7250.tar.gz
prosody-21784ddc118fb82a162f08162167ff9b609b7250.zip
util.argparse: Add test for #1691
-rw-r--r--spec/util_argparse_spec.lua7
1 files changed, 7 insertions, 0 deletions
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);