From 999456969dff0a85c48d421e52edd9d18a54161c Mon Sep 17 00:00:00 2001 From: Alexander Kuvaev Date: Sat, 22 Aug 2015 00:04:36 +0300 Subject: [PATCH] tests: test for multiple flags in single --- src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 916de169..55a76afc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1228,5 +1228,18 @@ mod tests { assert!(m.is_present("color")); } + #[test] + fn multiple_flags_in_single() { + let m = App::new("multe_flags") + .args(vec![ + Arg::from_usage("-f, --flag 'some flag'"), + Arg::from_usage("-c, --color 'some other flag'"), + Arg::from_usage("-d, --debug 'another other flag'") + ]) + .get_matches_from(vec!["", "-fcd"]); + assert!(m.is_present("flag")); + assert!(m.is_present("color")); + assert!(m.is_present("debug")); + } } \ No newline at end of file