Skip to content

Commit

Permalink
Improve error message, fix test assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
waltdisgrace committed Jul 8, 2020
1 parent ea97fa3 commit 35d410a
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/lineardev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,9 @@ impl FromStr for FlakeyTargetParams {
))
} else {
let err_msg = format!(
"expected {} feature arguments, found a number smaller than that",
vals[5]
"Expected {} feature arguments but found {}",
vals[5],
vals.len() - 6
);
Err(DmError::Dm(ErrorEnum::Invalid, err_msg))
}
Expand Down Expand Up @@ -947,13 +948,9 @@ mod tests {
}

#[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);
let result = "flakey 8:32 0 16 2 3 error_writes drop_writes".parse::<FlakeyTargetParams>();
assert_matches!(result, Err(DmError::Dm(ErrorEnum::Invalid, _)));
}

#[test]
Expand Down

0 comments on commit 35d410a

Please sign in to comment.