@Test public void unusedAssignments() { Program program = new SimpleProgramBuilder().emitWrite("x").buildProgram(); Assert.assertEquals( Collections.singleton((WriteInstruction) program.get(0)), program.getUnusedAssignments()); }
@Test public void unreachable() { Program program = new SimpleProgramBuilder().emitRet().emitNop().buildProgram(); Assert.assertEquals( Collections.singleton(program.get(1)), program.getUnreachableInstructions()); }
@Test public void unitializedReads() { Program program = new SimpleProgramBuilder().emitRead("x").buildProgram(); Assert.assertEquals( Collections.singleton((ReadInstruction) program.get(0)), program.getUninitializedReads()); }
@Test public void expectedReturns() { Program program = new SimpleProgramBuilder().emitNop().buildProgram(); Assert.assertEquals(Collections.singleton(program.get(0)), program.getExpectedReturns()); }