diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2023-11-05 21:49:24 +0100 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2023-11-05 21:49:24 +0100 |
commit | fd29f23d000db081da1976659e72a679b4ebb9c4 (patch) | |
tree | 5a26aae022eb141f173906915f5e0951b042a399 /tests | |
parent | c5607d106449cc3c8680e95ec8595370996d5fb1 (diff) |
core: Renamed tree related classes
Diffstat (limited to 'tests')
-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"); } } } |