AK: Improve HashTable::remove_all_matching() test slightly

After removing some entries, we now also verify that the correct
entries remain in the table. :^)
This commit is contained in:
Andreas Kling 2022-01-05 17:13:56 +01:00
parent bcc0186bbc
commit 8f5c1ef29c

View file

@ -84,7 +84,7 @@ TEST_CASE(table_remove)
EXPECT(strings.find("Two") != strings.end());
}
TEST_CASE(table_remove_all_matching)
TEST_CASE(remove_all_matching)
{
HashTable<int> ints;
@ -100,6 +100,9 @@ TEST_CASE(table_remove_all_matching)
EXPECT_EQ(ints.size(), 2u);
EXPECT(ints.contains(1));
EXPECT(ints.contains(2));
EXPECT_EQ(ints.remove_all_matching([&](int) { return true; }), true);
EXPECT(ints.is_empty());