Unit test to verify that conflicting output styles result in an error

This commit is contained in:
Olivier Tilloy
2024-04-05 23:22:26 +02:00
parent c08e0b6e1f
commit c325291696
+11
View File
@@ -502,4 +502,15 @@ mod tests {
fn empty() {
assert!(parse_params([].iter().cloned()).is_err());
}
#[test]
fn conflicting_output_styles() {
for (arg1, arg2) in [("-u", "-c"), ("-u", "-e"), ("-c", "-u"), ("-c", "-U42")] {
assert!(parse_params(
[os("diff"), os(arg1), os(arg2), os("foo"), os("bar")]
.iter()
.cloned()
)
.is_err());
}
}
}