Software / code / prosody
Changeset
11845:97c1399720c2
util.argparse: Add test for #1691
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 12 Oct 2021 14:54:04 +0200 |
| parents | 11843:d2a939e21671 |
| children | 11846:6425dfa3de45 |
| files | spec/util_argparse_spec.lua |
| diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/spec/util_argparse_spec.lua Tue Oct 12 14:48:21 2021 +0200 +++ b/spec/util_argparse_spec.lua Tue Oct 12 14:54:04 2021 +0200 @@ -43,4 +43,11 @@ 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);