tests: removes some instances of println in the tests

This commit is contained in:
Kevin K 2018-01-25 16:23:12 -05:00
parent 7788ef70d9
commit 78090e5529
No known key found for this signature in database
GPG key ID: 17218E4B3692F01A
3 changed files with 10 additions and 12 deletions

View file

@ -249,8 +249,8 @@ fn unified_help() {
.setting(AppSettings::UnifiedHelpMessage)
.args_from_usage(
"-f, --flag 'some flag'
[arg1] 'some pos arg'
--option [opt] 'some option'",
[arg1] 'some pos arg'
--option [opt] 'some option'",
);
assert!(test::compare_output(

View file

@ -683,10 +683,8 @@ fn multi_level_sc_help() {
.author("Kevin K. <kbknapp@gmail.com>")
.version("0.1")
.args_from_usage(
"
-f, --flag 'tests flags'
-o, --option [scoption]... 'tests options'
",
"-f, --flag 'tests flags'
-o, --option [scoption]... 'tests options'",
),
),
);

View file

@ -228,7 +228,7 @@ fn option_min_less() {
#[test]
fn option_short_min_more_mult_occurs() {
let m = App::new("multiple_values")
let res = App::new("multiple_values")
.arg(Arg::with_name("arg").required(true))
.arg(
Arg::with_name("option")
@ -242,8 +242,8 @@ fn option_short_min_more_mult_occurs() {
"", "pos", "-o", "val1", "-o", "val2", "-o", "val3", "-o", "val4"
]);
let m = m.map_err(|e| println!("failed to unwrap err with error kind {:?}", e.kind))
.unwrap();
assert!(res.is_ok(), "{:?}", res.unwrap_err().kind);
let m = res.unwrap();
assert!(m.is_present("option"));
assert!(m.is_present("arg"));
@ -257,7 +257,7 @@ fn option_short_min_more_mult_occurs() {
#[test]
fn option_short_min_more_single_occur() {
let m = App::new("multiple_values")
let res = App::new("multiple_values")
.arg(Arg::with_name("arg").required(true))
.arg(
Arg::with_name("option")
@ -269,8 +269,8 @@ fn option_short_min_more_single_occur() {
)
.get_matches_from_safe(vec!["", "pos", "-o", "val1", "val2", "val3", "val4"]);
let m = m.map_err(|e| println!("failed to unwrap err with error kind {:#?}", e))
.unwrap();
assert!(res.is_ok(), "{:?}", res.unwrap_err().kind);
let m = res.unwrap();
assert!(m.is_present("option"));
assert!(m.is_present("arg"));