mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:17:35 +00:00
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:
parent
bcc0186bbc
commit
8f5c1ef29c
1 changed files with 4 additions and 1 deletions
|
@ -84,7 +84,7 @@ TEST_CASE(table_remove)
|
||||||
EXPECT(strings.find("Two") != strings.end());
|
EXPECT(strings.find("Two") != strings.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE(table_remove_all_matching)
|
TEST_CASE(remove_all_matching)
|
||||||
{
|
{
|
||||||
HashTable<int> ints;
|
HashTable<int> ints;
|
||||||
|
|
||||||
|
@ -100,6 +100,9 @@ TEST_CASE(table_remove_all_matching)
|
||||||
|
|
||||||
EXPECT_EQ(ints.size(), 2u);
|
EXPECT_EQ(ints.size(), 2u);
|
||||||
|
|
||||||
|
EXPECT(ints.contains(1));
|
||||||
|
EXPECT(ints.contains(2));
|
||||||
|
|
||||||
EXPECT_EQ(ints.remove_all_matching([&](int) { return true; }), true);
|
EXPECT_EQ(ints.remove_all_matching([&](int) { return true; }), true);
|
||||||
|
|
||||||
EXPECT(ints.is_empty());
|
EXPECT(ints.is_empty());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue