mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-04 06:13:10 +00:00
add test_pop_size
This commit is contained in:
parent
3ee40bcc0b
commit
9fb8eb19a1
@ -125,6 +125,19 @@ mod tests {
|
|||||||
assert_eq!(item, Some(&test_item_with_id(1)));
|
assert_eq!(item, Some(&test_item_with_id(1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_pop_size() {
|
||||||
|
let mut pool = MemPool::new();
|
||||||
|
pool.push_item(test_item_with_id(1));
|
||||||
|
pool.push_item(test_item_with_id(2));
|
||||||
|
pool.push_item(test_item_with_id(3));
|
||||||
|
|
||||||
|
let items = pool.pop_size(2);
|
||||||
|
assert_eq!(items, vec![test_item_with_id(1), test_item_with_id(2)]);
|
||||||
|
assert_eq!(pool.len(), 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_push_pop() {
|
fn test_push_pop() {
|
||||||
let mut mempool: MemPool<TestItem> = MemPool::new();
|
let mut mempool: MemPool<TestItem> = MemPool::new();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user