forked from mirrors/jj
Add test cases where HexPrefix::new fails due to invalid inputs
This commit is contained in:
parent
82b3017fda
commit
5c252bd8e4
1 changed files with 6 additions and 0 deletions
|
@ -224,6 +224,12 @@ mod tests {
|
|||
|
||||
let prefix = HexPrefix::new("123").unwrap();
|
||||
assert_eq!(prefix.min_prefix_bytes(), b"\x12\x30");
|
||||
|
||||
let bad_prefix = HexPrefix::new("0x123");
|
||||
assert_eq!(bad_prefix, None);
|
||||
|
||||
let bad_prefix = HexPrefix::new("foobar");
|
||||
assert_eq!(bad_prefix, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue