aboutsummaryrefslogtreecommitdiff
path: root/org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java')
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java
index a6fb15e8..a6a7ee6d 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java
@@ -93,6 +93,18 @@ public class InstructionTest {
}
@Test
+ public void merge_should_add_covered_branches_from_another_instruction() {
+ final Instruction i1 = new Instruction(new InsnNode(Opcodes.NOP), 123);
+ i1.setCovered(0);
+ final Instruction i2 = new Instruction(new InsnNode(Opcodes.NOP), 123);
+ i2.setCovered(1);
+ i1.merge(i2);
+ assertEquals("{0, 1}", i1.toString());
+ assertEquals(2, i1.getCoveredBranches());
+ assertEquals("{1}", i2.toString());
+ }
+
+ @Test
public void testSetCoveredOnLongSequence() {
final Instruction first = new Instruction(new InsnNode(Opcodes.NOP), 0);
Instruction next = first;