mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-02 16:25:34 +03: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
Notes:
sideshowbarker
2024-07-17 21:35:01 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/8f5c1ef29cd
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user