ok/jj
1
0
Fork 0
forked from mirrors/jj

Add test cases where HexPrefix::new fails due to invalid inputs

This commit is contained in:
Evan Mesterhazy 2024-02-12 16:01:11 -05:00 committed by Evan Mesterhazy
parent 82b3017fda
commit 5c252bd8e4

View file

@ -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]