mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 02:35:31 +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]
|
#[test]
|
||||||
fn test_parse_info_hash() {
|
fn test_parse_info_hash() {
|
||||||
assert!(
|
let f = AccessList::parse_info_hash;
|
||||||
AccessList::parse_info_hash("aaaabbbbccccddddeeeeaaaabbbbccccddddeeee".to_owned())
|
|
||||||
.is_ok()
|
assert!(f("aaaabbbbccccddddeeeeaaaabbbbccccddddeeee".into()).is_ok());
|
||||||
);
|
assert!(f("aaaabbbbccccddddeeeeaaaabbbbccccddddeeeef".into()).is_err());
|
||||||
assert!(AccessList::parse_info_hash(
|
assert!(f("aaaabbbbccccddddeeeeaaaabbbbccccddddeee".into()).is_err());
|
||||||
"aaaabbbbccccddddeeeeaaaabbbbccccddddeeeef".to_owned()
|
assert!(f("aaaabbbbccccddddeeeeaaaabbbbccccddddeeeö".into()).is_err());
|
||||||
)
|
|
||||||
.is_err());
|
|
||||||
assert!(
|
|
||||||
AccessList::parse_info_hash("aaaabbbbccccddddeeeeaaaabbbbccccddddeee".to_owned())
|
|
||||||
.is_err()
|
|
||||||
);
|
|
||||||
assert!(
|
|
||||||
AccessList::parse_info_hash("aaaabbbbccccddddeeeeaaaabbbbccccddddeeeö".to_owned())
|
|
||||||
.is_err()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue