From 19642310c63739cac6a9991938477cedcee8be3a Mon Sep 17 00:00:00 2001 From: Kunle <67528514+unw9527@users.noreply.github.com> Date: Mon, 18 Nov 2024 21:54:47 -0500 Subject: [PATCH] add(p2): test for deleting the only remaining node (#776) --- test/storage/b_plus_tree_delete_test.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/storage/b_plus_tree_delete_test.cpp b/test/storage/b_plus_tree_delete_test.cpp index c6bfa7afd..3b11f184a 100644 --- a/test/storage/b_plus_tree_delete_test.cpp +++ b/test/storage/b_plus_tree_delete_test.cpp @@ -81,6 +81,13 @@ TEST(BPlusTreeTests, DISABLED_DeleteTestNoIterator) { } } EXPECT_EQ(size, 1); + + // Remove the remaining key + index_key.SetFromInteger(2); + tree.Remove(index_key); + auto root_page_id = tree.GetRootPageId(); + ASSERT_EQ(root_page_id, INVALID_PAGE_ID); + delete bpm; }