Skip to content

Commit

Permalink
Merge pull request uutils#51 from oSoMoN/unit-tests-for-conflicting-o…
Browse files Browse the repository at this point in the history
…utput-style

Unit test to verify that conflicting output styles result in an error
  • Loading branch information
sylvestre authored Apr 6, 2024
2 parents c08e0b6 + c325291 commit 9507ca2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
}

0 comments on commit 9507ca2

Please sign in to comment.