Skip to content

Commit

Permalink
fix is_superset
Browse files Browse the repository at this point in the history
  • Loading branch information
drexlerd committed May 8, 2024
1 parent 242b0b4 commit fe16411
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/unit/types/bitset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,40 @@ TEST(FlatmemoryTests, TypesBitsetAndEqualTest)
EXPECT_FALSE(bitset_1.get(4));
}

TEST(FlatmemoryTests, TypesBitsetAreDisjointTest)
{
size_t num_bits_1 = 4;
auto bitset_1 = Builder<Bitset<uint64_t>>(num_bits_1, false);
bitset_1.set(1);

size_t num_bits_2 = 4;
auto bitset_2 = Builder<Bitset<uint64_t>>(num_bits_2, false);
bitset_2.set(2);

EXPECT_TRUE(bitset_1.are_disjoint(bitset_2));

bitset_2.set(1);

EXPECT_FALSE(bitset_1.are_disjoint(bitset_2));
}

TEST(FlatmemoryTests, TypesBitsetIsSupersetTest)
{
size_t num_bits_1 = 4;
auto bitset_1 = Builder<Bitset<uint64_t>>(num_bits_1, false);
bitset_1.set(1);

size_t num_bits_2 = 4;
auto bitset_2 = Builder<Bitset<uint64_t>>(num_bits_2, false);
bitset_2.set(2);

EXPECT_FALSE(bitset_2.is_superseteq(bitset_1));

bitset_2.set(1);

EXPECT_TRUE(bitset_2.is_superseteq(bitset_1));
}

TEST(FlatmemoryTests, TypesBitsetNotTest)
{
size_t num_bits = 3;
Expand Down

0 comments on commit fe16411

Please sign in to comment.