summaryrefslogtreecommitdiff
path: root/Tests/AK
diff options
context:
space:
mode:
authorTimothy <timmot@users.noreply.github.com>2021-07-14 10:20:41 +1000
committerAndreas Kling <kling@serenityos.org>2021-07-16 11:49:50 +0200
commit5f3e6085a215ed05be84b444468743fb9b232bd9 (patch)
tree86ecc393ee005f17ab874696f6ec8a16440567a4 /Tests/AK
parent971531183746d4481f6f475ef80bea90c6f03df5 (diff)
downloadserenity-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.cpp8
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));
+}