27 lines
529 B
C++
27 lines
529 B
C++
#include "gtest/gtest.h"
|
|
|
|
#include "mvcc/id.hpp"
|
|
|
|
TEST(IdTest, BasicUsageAndTotalOrdering) {
|
|
Id id0(0);
|
|
Id id1(1);
|
|
Id id2(1);
|
|
Id id3(id2);
|
|
Id id4 = id3;
|
|
Id id5(5);
|
|
|
|
ASSERT_EQ(id0 < id5, true);
|
|
ASSERT_EQ(id1 == id2, true);
|
|
ASSERT_EQ(id3 == id4, true);
|
|
ASSERT_EQ(id5 > id0, true);
|
|
ASSERT_EQ(id5 > id0, true);
|
|
ASSERT_EQ(id5 != id3, true);
|
|
ASSERT_EQ(id1 >= id2, true);
|
|
ASSERT_EQ(id3 <= id4, true);
|
|
}
|
|
|
|
int main(int argc, char **argv) {
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
return RUN_ALL_TESTS();
|
|
}
|