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 af8a2c1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/lineardev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,7 @@ 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 +946,10 @@ 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);
.parse::<FlakeyTargetParams>();
assert_matches!(result, Err(DmError::Dm(ErrorEnum::Invalid, _)));
}

#[test]
Expand Down

0 comments on commit af8a2c1

Please sign in to comment.