|
|
@@ -45,6 +45,16 @@ std::vector<int> flatten(Iter it) {
|
|
|
return out;
|
|
|
}
|
|
|
|
|
|
+TEST_F(TrieTest, DefaultConstructorHasNoElementsExceptRoot) {
|
|
|
+ Tree empty;
|
|
|
+ EXPECT_THAT(flatten(empty.cbegin()), std::vector<int>{0});
|
|
|
+}
|
|
|
+
|
|
|
+TEST_F(TrieTest, MoveConstructorIsDestructive) {
|
|
|
+ Tree moved = std::move(data);
|
|
|
+ EXPECT_THAT(flatten(data.cbegin()), std::vector<int>{0});
|
|
|
+}
|
|
|
+
|
|
|
TEST_F(TrieTest, CopyConstructorIsDeep) {
|
|
|
Tree copy = data;
|
|
|
copy[{0, 1}] += 1;
|