We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e9be03 commit a66f068Copy full SHA for a66f068
src/test/stdtest/getopts.rs
@@ -444,10 +444,11 @@ fn test_unrecognized_option_short() {
444
fn test_combined() {
445
let args =
446
["prog", "free1", "-s", "20", "free2", "--flag", "--long=30", "-f",
447
- "-m", "40", "-m", "50"];
+ "-m", "40", "-m", "50", "-n", "-A B", "-n", "-60 70"];
448
let opts =
449
[opt::optopt("s"), opt::optflag("flag"), opt::reqopt("long"),
450
- opt::optflag("f"), opt::optmulti("m"), opt::optopt("notpresent")];
+ opt::optflag("f"), opt::optmulti("m"), opt::optmulti("n"),
451
+ opt::optopt("notpresent")];
452
let rs = opt::getopts(args, opts);
453
alt rs {
454
ok(m) {
@@ -460,6 +461,8 @@ fn test_combined() {
460
461
assert (opt::opt_present(m, "f"));
462
assert (opt::opt_strs(m, "m")[0] == "40");
463
assert (opt::opt_strs(m, "m")[1] == "50");
464
+ assert (opt::opt_strs(m, "n")[0] == "-A B");
465
+ assert (opt::opt_strs(m, "n")[1] == "-60 70");
466
assert (!opt::opt_present(m, "notpresent"));
467
}
468
_ { fail; }
0 commit comments