#include "src/zone/zone-compact-set.h"
#include "src/zone/zone.h"
#include "test/unittests/test-utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace v8 {
namespace internal {
struct HandleLike { … };
bool operator==(HandleLike lhs, HandleLike rhs) { … }
template <>
struct ZoneCompactSetTraits<HandleLike> {
using handle_type = HandleLike;
using data_type = int;
static data_type* HandleToPointer(handle_type handle) { return handle.ptr; }
static handle_type PointerToHandle(data_type* ptr) { return HandleLike{ptr}; }
};
class ZoneCompactSetTest : public TestWithZone { … };
TEST_F(ZoneCompactSetTest, Empty) { … }
TEST_F(ZoneCompactSetTest, SingleValue) { … }
TEST_F(ZoneCompactSetTest, MultipleValue) { … }
TEST_F(ZoneCompactSetTest, DuplicateValue) { … }
TEST_F(ZoneCompactSetTest, RemoveSingleValue) { … }
TEST_F(ZoneCompactSetTest, RemoveFromMultipleValue) { … }
TEST_F(ZoneCompactSetTest, RemoveFromEvenMoreMultipleValue) { … }
TEST_F(ZoneCompactSetTest, RemoveNonExistent) { … }
TEST_F(ZoneCompactSetTest, ContainsEmptySubset) { … }
TEST_F(ZoneCompactSetTest, ContainsSingleElementSubset) { … }
TEST_F(ZoneCompactSetTest, ContainsMultiElementSubset) { … }
TEST_F(ZoneCompactSetTest, DoesNotContainsNonSubset) { … }
}
}