diff options
Diffstat (limited to 'tests/tree.cpp')
-rw-r--r-- | tests/tree.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/tree.cpp b/tests/tree.cpp index de6bda6..ca57a17 100644 --- a/tests/tree.cpp +++ b/tests/tree.cpp @@ -5,16 +5,16 @@ namespace { SAW_TEST("Tree insert"){ using namespace saw; - tree_or<int> troi; + tree<int> troi; { // Replace with value - auto eor = troi.replace_tree(5); + auto eor = troi.replace_branch(5); SAW_EXPECT(eor.is_value(), "Didn't manage to replace with value"); } { - // Replace with tree again - auto eor = troi.replace_value(tree<int>{}); + // Replace with branch again + auto eor = troi.replace_value(branch<int>{}); SAW_EXPECT(eor.is_value(), "Not a value"); } @@ -23,16 +23,20 @@ SAW_TEST("Tree insert"){ SAW_TEST("Tree add child"){ using namespace saw; - tree<int> tr; + branch<int> tr; { auto eov = tr.add(10); SAW_EXPECT(eov.is_value(), "Didn't manage to add value"); } { auto eov = tr.add(); - SAW_EXPECT(eov.is_value(), "Didn't manage to add tree"); + SAW_EXPECT(eov.is_value(), "Didn't manage to add branch"); std::size_t index = eov.get_value(); + auto& inner_tr = tr.at(index); + + auto eov2 = inner_tr.get_branch().add(420); + SAW_EXPECT(eov2.is_value(), "Didn't manage to add to inner branch"); } } } |