diff options
author | Timothy <timmot@users.noreply.github.com> | 2021-07-14 10:20:41 +1000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-16 11:49:50 +0200 |
commit | 5f3e6085a215ed05be84b444468743fb9b232bd9 (patch) | |
tree | 86ecc393ee005f17ab874696f6ec8a16440567a4 /Tests/AK | |
parent | 971531183746d4481f6f475ef80bea90c6f03df5 (diff) | |
download | serenity-5f3e6085a215ed05be84b444468743fb9b232bd9.zip |
AK/Tests: Add test for EnumBits has_any_flag()
This test will pass when any flag in the mask is present in the value.
Diffstat (limited to 'Tests/AK')
-rw-r--r-- | Tests/AK/TestEnumBits.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/AK/TestEnumBits.cpp b/Tests/AK/TestEnumBits.cpp index f49e13b263..bb53857e34 100644 --- a/Tests/AK/TestEnumBits.cpp +++ b/Tests/AK/TestEnumBits.cpp @@ -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)); +} |