blob: 2515ee943cf69849704c378a8624c6e2f774c646 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include <forstio/test/suite.h>
#include <forstio/core/tree.h>
namespace {
SAW_TEST("Tree add child"){
using namespace saw;
tree<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");
std::size_t index = eov.get_value();
auto& inner_tr = tr.at(index);
auto eov2 = inner_tr.get_tree().add(420);
SAW_EXPECT(eov2.is_value(), "Didn't manage to add to inner tree");
}
}
}
|