Skip to content

Commit

Permalink
test(N5TreeNode): adding child nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
bogovicj committed May 3, 2024
1 parent a3cd67f commit ab1759d
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
public class N5TreeNodeTest {

@Test
public void testStructureEquals()
{
public void testStructureEquals() {

N5TreeNode empty = new N5TreeNode("");

N5TreeNode a = new N5TreeNode("a");
Expand Down Expand Up @@ -49,8 +49,8 @@ public void testStructureEquals()
}

@Test
public void testAddingChildren()
{
public void testAddingChildren() {

final N5TreeNode control = new N5TreeNode("");
final N5TreeNode a = new N5TreeNode("a");
final N5TreeNode b = new N5TreeNode("a/b");
Expand All @@ -75,7 +75,11 @@ public void testAddingChildren()
control.add(ant);
ant.add(bat);

root.addPath("ant/bat");
N5TreeNode ab = root.addPath("ant/bat");
assertEquals("ant/bat", ab.getPath());
assertEquals(0, ab.getDescendants(x -> { return x != ab; }).count());


assertTrue( root.getDescendant("ant/bat").isPresent() );
// make sure the tree has expected structure
assertTrue( root.structureEquals(control));
Expand Down

0 comments on commit ab1759d

Please sign in to comment.