Skip to content

Commit

Permalink
Add tests for correct and incorrect feature argument number inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
waltdisgrace committed Jul 9, 2020
1 parent f82b804 commit c0cce05
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/lineardev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,28 @@ mod tests {
assert_eq!(result.feature_args, expected);
}

#[test]
fn test_flakey_correct_feature_args_input() {
let result = "flakey 8:32 0 16 2 2 error_writes drop_writes"
.parse::<FlakeyTargetParams>()
.unwrap();
let expected = [FeatureArg::ErrorWrites, FeatureArg::DropWrites]
.iter()
.cloned()
.collect::<HashSet<_>>();
assert_eq!(result.feature_args, expected);
}

#[test]
#[should_panic]
fn test_flakey_incorrect_feature_args_input() {
let result = "flakey 8:32 0 16 2 3 error_writes drop_writes"
.parse::<FlakeyTargetParams>()
.unwrap();
let expected = vec![].iter().cloned().collect::<HashSet<_>>();
assert_eq!(result.feature_args, expected);
}

#[test]
fn loop_test_duplicate_segments() {
test_with_spec(1, test_duplicate_segments);
Expand Down

0 comments on commit c0cce05

Please sign in to comment.