Skip to content

Commit

Permalink
add double extend test
Browse files Browse the repository at this point in the history
  • Loading branch information
Firstyear committed Oct 11, 2023
1 parent 74489f2 commit 2deaed8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/internals/bptree/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2694,6 +2694,25 @@ mod tests {
}
}

#[test]
fn test_bptree_cursor_double_extend() {
let node: *mut Leaf<isize, isize> = Node::new_leaf(0) as *mut _;
let sb = SuperBlock::new_test(1, node as *mut Node<isize, isize>);
let mut wcurs = sb.create_writer();

wcurs.extend([(0, 0), (1, 1), (2, 2), (3, 3)].into_iter());
assert!(wcurs.len() == 4);
assert!(wcurs.verify());

wcurs.extend([(2, 2), (3, 3), (4, 4), (5, 5)].into_iter());
assert!(wcurs.len() == 6);
assert!(wcurs.verify());

mem::drop(wcurs);
mem::drop(sb);
assert_released();
}

/*
#[test]
fn test_bptree_cursor_get_mut_ref_1() {
Expand Down

0 comments on commit 2deaed8

Please sign in to comment.