mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_common: make info hash parse test code look nicer
This commit is contained in:
parent
ba787c3361
commit
40b7bfe309
1 changed files with 6 additions and 16 deletions
|
|
@ -76,21 +76,11 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_parse_info_hash() {
|
||||
assert!(
|
||||
AccessList::parse_info_hash("aaaabbbbccccddddeeeeaaaabbbbccccddddeeee".to_owned())
|
||||
.is_ok()
|
||||
);
|
||||
assert!(AccessList::parse_info_hash(
|
||||
"aaaabbbbccccddddeeeeaaaabbbbccccddddeeeef".to_owned()
|
||||
)
|
||||
.is_err());
|
||||
assert!(
|
||||
AccessList::parse_info_hash("aaaabbbbccccddddeeeeaaaabbbbccccddddeee".to_owned())
|
||||
.is_err()
|
||||
);
|
||||
assert!(
|
||||
AccessList::parse_info_hash("aaaabbbbccccddddeeeeaaaabbbbccccddddeeeö".to_owned())
|
||||
.is_err()
|
||||
);
|
||||
let f = AccessList::parse_info_hash;
|
||||
|
||||
assert!(f("aaaabbbbccccddddeeeeaaaabbbbccccddddeeee".into()).is_ok());
|
||||
assert!(f("aaaabbbbccccddddeeeeaaaabbbbccccddddeeeef".into()).is_err());
|
||||
assert!(f("aaaabbbbccccddddeeeeaaaabbbbccccddddeee".into()).is_err());
|
||||
assert!(f("aaaabbbbccccddddeeeeaaaabbbbccccddddeeeö".into()).is_err());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue