summaryrefslogtreecommitdiff
path: root/tests/tree.cpp
blob: a33f0b13d3af66a32e670d361ceaa0fc447be92f (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <forstio/test/suite.h>
#include <forstio/core/tree.h>

namespace {
/*
SAW_TEST("Tree insert"){
	using namespace saw;

	branch<int> troi;
	{
		// Replace with value
		auto eor = troi.replace_tree(5);

		SAW_EXPECT(eor.is_value(), "Didn't manage to replace with value");
	}
	{
		// Replace with tree again
		auto eor = troi.replace_value(tree<int>{});

		SAW_EXPECT(eor.is_value(), "Not a value");
	}
}

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");
	}
}
*/
}