1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:17:35 +00:00

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

View file

@ -68,3 +68,11 @@ TEST_CASE(has_flag)
EXPECT(!has_flag(intro, VideoIntro::Well)); EXPECT(!has_flag(intro, VideoIntro::Well));
EXPECT(!has_flag(intro, VideoIntro::CompleteIntro)); 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));
}