test/com/google/javascript/jscomp/parsing/ParserTest.java
/**
   * Verify that the given code has the given parse errors.
   * @return If in IDE mode, returns a partial tree.
   */
Verify that the given code has the given parse errors.
@return If in IDE mode, returns a partial tree.
Verify that the given code has the given parse errors . @return If in IDE mode returns a partial tree .
private Node parseError(String source, String... errors) {
    TestErrorReporter testErrorReporter = new TestErrorReporter(errors, null);
    ParseResult result =
        ParserRunner.parse(
            new SimpleSourceFile("input", SourceKind.STRONG),
            source,
            createConfig(),
            testErrorReporter);
    Node script = result.ast;
    assertFS(result.features).contains(expectedFeatures);
    testErrorReporter.assertHasEncounteredAllErrors();
    testErrorReporter.assertHasEncounteredAllWarnings();
    return script;
  }
private Node parseError ( String source , String ... errors ) { TestErrorReporter testErrorReporter = new TestErrorReporter ( errors , null ) ; ParseResult result = ParserRunner . parse ( new SimpleSourceFile ( "input" , SourceKind . STRONG ) , source , createConfig ( ) , testErrorReporter ) ; Node script = result . ast ; assertFS ( result . features ) . contains ( expectedFeatures ) ; testErrorReporter . assertHasEncounteredAllErrors ( ) ; testErrorReporter . assertHasEncounteredAllWarnings ( ) ; return script ; }
Verify that the given code has the given parse errors.
Verify that the given code has the given parse errors .
// check expected features if specified // verifying that all errors were seen