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 9, 2020
1 parent c0cce05 commit 05c3a7f
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 05c3a7f

Please sign in to comment.