Kind::is_match works so far

args
Avril 4 years ago
parent 1fa8286fd6
commit c3feca0622
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -47,7 +47,7 @@ impl<'b> Kind<'b>
///
/// Returns the matched part.
/// # Note
/// In this case of `Short` (or `Abrev` short match), return the rest of the argument string including the matched character
/// In this case of `Short` (or `Abrev` short match), return the rest of the argument string *not* including the matched character
///
/// # Short case-sensitivity
/// Single character matching case sensitivity can produce unexpected results if the lowercase transform of that character yields multiple characters. They are all checked for match.
@ -409,4 +409,17 @@ mod tests
//return Err(err)?;
Ok(())
}
#[test]
fn kind_is_match()
{
let kd = Kind::Abrev(&["logging:high", "verbose", "verbose-mode"], &[('V',)], true, true);
let args = over!["--logging:high", "--verbose", "-abcVdfg"];
for arg in args
{
assert!(kd.is_match(arg).is_some());
}
}
}

Loading…
Cancel
Save