memgraph/tests/unit/id.cpp
2017-02-19 23:47:09 +01:00

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();
}