+TEST(SmallBitVectorTest, CompoundAssignment) {
+ SmallBitVector A;
+ A.resize(10);
+ A.set(4);
+ A.set(7);
+
+ SmallBitVector B;
+ B.resize(50);
+ B.set(5);
+ B.set(18);
+
+ A |= B;
+ EXPECT_TRUE(A.test(4));
+ EXPECT_TRUE(A.test(5));
+ EXPECT_TRUE(A.test(7));
+ EXPECT_TRUE(A.test(18));
+ EXPECT_EQ(A.count(), 4);
+ EXPECT_EQ(A.size(), 50);
+
+ B.resize(10);
+ B.set();
+ B.reset(2);
+ B.reset(7);
+ A &= B;
+ EXPECT_FALSE(A.test(2));
+ EXPECT_FALSE(A.test(7));
+ EXPECT_EQ(A.size(), 50);
+ EXPECT_EQ(A.count(), 2);
+
+ B.resize(100);
+ B.set();
+
+ A ^= B;
+ EXPECT_TRUE(A.test(2));
+ EXPECT_TRUE(A.test(7));
+ EXPECT_EQ(A.size(), 100);
+ EXPECT_EQ(A.count(), 98);
+}
+