diff --git a/tests/multiple_values.rs b/tests/multiple_values.rs index e8b515ff8cb..de36c41accb 100644 --- a/tests/multiple_values.rs +++ b/tests/multiple_values.rs @@ -582,3 +582,43 @@ fn multiple_values_different_sep_positional() { assert_eq!(m.occurrences_of("option"), 1); assert_eq!(m.values_of("option").unwrap().collect::>(), ["val1", "val2", "val3"]); } + +#[test] +fn multiple_values_no_sep() { + let m = App::new("multiple_values") + .arg(Arg::with_name("option") + .long("option") + .help("multiple options") + .takes_value(true) + .use_delimiter(false)) + .get_matches_from_safe(vec![ + "", + "--option=val1,val2,val3", + ]); + + assert!(m.is_ok()); + let m = m.unwrap(); + + assert!(m.is_present("option")); + assert_eq!(m.occurrences_of("option"), 1); + assert_eq!(m.value_of("option").unwrap(), "val1,val2,val3"); +} + +#[test] +fn multiple_values_no_sep_positional() { + let m = App::new("multiple_values") + .arg(Arg::with_name("option") + .help("multiple options") + .use_delimiter(false)) + .get_matches_from_safe(vec![ + "", + "val1,val2,val3", + ]); + + assert!(m.is_ok()); + let m = m.unwrap(); + + assert!(m.is_present("option")); + assert_eq!(m.occurrences_of("option"), 1); + assert_eq!(m.value_of("option").unwrap(), "val1,val2,val3"); +}