Software /
code /
prosody
Comparison
spec/util_argparse_spec.lua @ 12478:82270a6b1234
Merge 0.12->trunk
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 25 Apr 2022 16:35:10 +0100 |
parent | 12477:cc84682b8429 |
child | 13160:4ee9a912ceea |
comparison
equal
deleted
inserted
replaced
12476:d8a6e03a7161 | 12478:82270a6b1234 |
---|---|
18 | 18 |
19 it("consumes input until the first argument", function() | 19 it("consumes input until the first argument", function() |
20 local arg = { "--foo"; "bar"; "--baz" }; | 20 local arg = { "--foo"; "bar"; "--baz" }; |
21 local opts, err = parse(arg); | 21 local opts, err = parse(arg); |
22 assert.falsy(err); | 22 assert.falsy(err); |
23 assert.same({ foo = true }, opts); | 23 assert.same({ foo = true, "bar", "--baz" }, opts); |
24 assert.same({ "bar"; "--baz" }, arg); | 24 assert.same({ "bar"; "--baz" }, arg); |
25 end); | 25 end); |
26 | 26 |
27 it("expands short options", function() | 27 it("expands short options", function() |
28 local opts, err = parse({ "--foo"; "-b" }, { short_params = { b = "bar" } }); | 28 local opts, err = parse({ "--foo"; "-b" }, { short_params = { b = "bar" } }); |