Diff

spec/util_argparse_spec.lua @ 11845:97c1399720c2

util.argparse: Add test for #1691
author Kim Alvefur <zash@zash.se>
date Tue, 12 Oct 2021 14:54:04 +0200
parent 11843:d2a939e21671
child 12477:cc84682b8429
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);