fix: Assert on an expected error rather than failing if we get Ok
The clippy lints assertions_on_constants and single_match were pointing
at this spot, so it's as good a time as any to take care of the TODO!
@@ -260,10 +260,8 @@ mod tests {
let src = vec![7, 6, 2 << (61 - 1), 4, 3, 2, 1];
let mut encoded = vec![];
- match encode_all(&src, &mut encoded) {
- Ok(_) => assert!(false), // TODO(edd): fix this silly assertion
- Err(_) => (),
- }
+ let result = encode_all(&src, &mut encoded);
+ assert_eq!(result.unwrap_err().to_string(), "value out of bounds");
}
#[test]
