Modified: trunk/Tools/ChangeLog (225142 => 225143)
--- trunk/Tools/ChangeLog 2017-11-25 01:09:58 UTC (rev 225142)
+++ trunk/Tools/ChangeLog 2017-11-25 01:49:57 UTC (rev 225143)
@@ -1,3 +1,8 @@
+2017-11-24 Darin Adler <[email protected]>
+
+ * TestWebKitAPI/Tests/WTF/OptionSet.cpp:
+ (TestWebKitAPI::TEST): Added a test for OptionSet operator|.
+
2017-11-24 Mark Lam <[email protected]>
Move unsafe jsc shell test functions to the $vm object.
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/OptionSet.cpp (225142 => 225143)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/OptionSet.cpp 2017-11-25 01:09:58 UTC (rev 225142)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/OptionSet.cpp 2017-11-25 01:49:57 UTC (rev 225143)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -77,10 +77,20 @@
EXPECT_FALSE(set != ExampleFlags::A);
}
+TEST(WTF_OptionSet, Or)
+{
+ OptionSet<ExampleFlags> set { ExampleFlags::A, ExampleFlags::B, ExampleFlags::C };
+ OptionSet<ExampleFlags> set2 { ExampleFlags::C, ExampleFlags::D };
+
+ EXPECT_TRUE(((set | ExampleFlags::A) == OptionSet<ExampleFlags> { ExampleFlags::A, ExampleFlags::B, ExampleFlags::C }));
+ EXPECT_TRUE(((set | ExampleFlags::D) == OptionSet<ExampleFlags> { ExampleFlags::A, ExampleFlags::B, ExampleFlags::C, ExampleFlags::D }));
+ EXPECT_TRUE(((set | set2) == OptionSet<ExampleFlags> { ExampleFlags::A, ExampleFlags::B, ExampleFlags::C, ExampleFlags::D }));
+}
+
TEST(WTF_OptionSet, Minus)
{
OptionSet<ExampleFlags> set { ExampleFlags::A, ExampleFlags::B, ExampleFlags::C };
-
+
EXPECT_TRUE(((set - ExampleFlags::A) == OptionSet<ExampleFlags> { ExampleFlags::B, ExampleFlags::C }));
EXPECT_TRUE(((set - ExampleFlags::D) == OptionSet<ExampleFlags> { ExampleFlags::A, ExampleFlags::B, ExampleFlags::C }));
EXPECT_TRUE((set - set).isEmpty());