@Test
public void doReduction() throws Exception {

  File tempFile = testFolder.newFile("temp.frag");
  File tempJsonFile = testFolder.newFile("temp.json");
  String program = "void main() { if(_GLF_DEAD(_GLF_FALSE(false, false))) { } }";
  FileUtils.writeStringToFile(tempFile, program, StandardCharsets.UTF_8);
  FileUtils.writeStringToFile(tempJsonFile, "{ }", StandardCharsets.UTF_8);
  ShadingLanguageVersion version = ShadingLanguageVersion.ESSL_100;
  IRandom generator = new RandomWrapper(0);
  TranslationUnit tu = ParseHelper.parse(tempFile);
  ShaderJob state = new GlslShaderJob(
      Optional.empty(),
      new PipelineInfo(tempJsonFile),
      tu);
  IFileJudge pessimist = new IFileJudge() {
    // Says interesting first time, and uninteresting thereafter.
    boolean first = true;
    @Override
    public boolean isInteresting(
        File shaderJobFile,
        File shaderResultFileOutput
    ) {
      if (first) {
        first = false;
        return true;
      }
      return false;
    }
  };
  List<IReductionOpportunity> ops = ReductionOpportunities.getReductionOpportunities(
              MakeShaderJobFromFragmentShader.make(tu),
              new ReducerContext(false, version, generator, new IdGenerator()),
              fileOps);
  assertEquals(3, ops.size());
  new ReductionDriver(
      new ReducerContext(
          false,
          version,
          generator,
          new IdGenerator()),
      false,
      fileOps, pessimist, testFolder.getRoot())
      .doReduction(state, getPrefix(tempFile), 0, -1);
}