- Implemented `getValue()`

Graph (unittests)

- Added tests for `getValue()`
This commit is contained in:
Tristan B. Velloza Kildaire 2024-05-04 10:48:10 +02:00
parent 9610689e14
commit 1ebed93db7
1 changed files with 15 additions and 0 deletions

View File

@ -764,6 +764,17 @@ public class Graph(T)
this.value = value;
}
/**
* Obtains the value associated with
* this graph node
*
* Returns: the value `T`
*/
public T getValue()
{
return this.value;
}
/**
* Appends another graph node
* to the array of children
@ -1054,6 +1065,10 @@ unittest
assert(treeOfStrings.opIndex!(Graph!(string))(1) == subtree_2);
assert(treeOfStrings.opIndex!(Graph!(string))(2) == subtree_3);
assert(treeOfStrings[0] == subtree_1.getValue());
assert(treeOfStrings[1] == subtree_2.getValue());
assert(treeOfStrings[2] == subtree_3.getValue());
InclusionStratergy!(string) strat = toDelegate(&Always!(string));
TouchStratergy!(string) touch = toDelegate(&DebugTouch!(string));