AK/Tests: Add test for EnumBits has_any_flag()

This test will pass when any flag in the mask is present in the value.
This commit is contained in:
Timothy 2021-07-14 10:20:41 +10:00 committed by Andreas Kling
parent 9715311837
commit 5f3e6085a2
Notes: sideshowbarker 2024-07-18 08:56:44 +09:00

View File

@ -68,3 +68,11 @@ TEST_CASE(has_flag)
EXPECT(!has_flag(intro, VideoIntro::Well));
EXPECT(!has_flag(intro, VideoIntro::CompleteIntro));
}
TEST_CASE(has_any_flag)
{
auto intro = VideoIntro::Hello | VideoIntro::Friends;
EXPECT(has_any_flag(intro, VideoIntro::Friends));
EXPECT(!has_any_flag(intro, VideoIntro::Well));
EXPECT(has_any_flag(intro, VideoIntro::CompleteIntro));
}