util.argparse: Add test for #1691
authorKim Alvefur <zash@zash.se>
Tue, 12 Oct 2021 14:54:04 +0200
changeset 11849 97c1399720c2
parent 11847 d2a939e21671
child 11850 6425dfa3de45
util.argparse: Add test for #1691
spec/util_argparse_spec.lua
--- 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);