diff --git a/src/main/java/org/cqfn/astranaut/core/algorithms/NodeAllocator.java b/src/main/java/org/cqfn/astranaut/core/algorithms/NodeAllocator.java index 5a0e310..67a283b 100644 --- a/src/main/java/org/cqfn/astranaut/core/algorithms/NodeAllocator.java +++ b/src/main/java/org/cqfn/astranaut/core/algorithms/NodeAllocator.java @@ -130,7 +130,6 @@ private boolean fullMapping(final Node[] destination, final List source) { break; } result = this.bindAllNodes(destination, array); - assert !result || this.required.getCount() == 0; } while (false); return result; } diff --git a/src/test/java/org/cqfn/astranaut/core/algorithms/LabeledTreeBuilderTest.java b/src/test/java/org/cqfn/astranaut/core/algorithms/LabeledTreeBuilderTest.java index d0f53cc..89b757c 100644 --- a/src/test/java/org/cqfn/astranaut/core/algorithms/LabeledTreeBuilderTest.java +++ b/src/test/java/org/cqfn/astranaut/core/algorithms/LabeledTreeBuilderTest.java @@ -26,6 +26,7 @@ import java.util.Collections; import java.util.Optional; import org.cqfn.astranaut.core.base.Node; +import org.cqfn.astranaut.core.base.PrototypeBasedNode; import org.cqfn.astranaut.core.base.Tree; import org.cqfn.astranaut.core.example.LittleTrees; import org.junit.jupiter.api.Assertions; @@ -51,5 +52,8 @@ void testBaseMethods() { .findFirst(node -> node.getTypeName().equals(target.getTypeName())); Assertions.assertTrue(colored.isPresent()); Assertions.assertEquals(colored.get().getProperties().get(name), value); + final Node root = labeled.getRoot(); + Assertions.assertTrue(root instanceof PrototypeBasedNode); + Assertions.assertSame(((PrototypeBasedNode) root).getPrototype(), original); } }