@Test
public void testCanRemovePrecisionStatements() throws Exception {

  final String shader = "#version 310 es\n"
      + "precision highp float;\n"
      + "precision highp int;\n"
      + "precision mediump float;\n"
      + "precision lowp int;\n"
      + "precision highp int;\n"
      + "precision highp float;\n"
      + "void main() {\n"
      + "}\n";
  final TranslationUnit tu = ParseHelper.parse(shader);
  List<IReductionOpportunity> ops = ReductionOpportunities.getReductionOpportunities(
      MakeShaderJobFromFragmentShader.make(tu), new ReducerContext(false,
          ShadingLanguageVersion.ESSL_310,
          new RandomWrapper(0), new IdGenerator()), fileOps);
  // We expect two less than the number of precision declarations above.
  assertEquals(4, ops.size());
}